If you would rather call or email us later please see the contact information below:
Email: info@islamicspeakers.ca
<% } %>
%@page session="false" autoFlush="true" isErrorPage="false" %> <%@ page import="java.util.Calendar" %> <%@ page import="javax.mail.Session" %> <%@ page import="java.util.Properties" %> <%@ page import="javax.mail.Message" %> <%@ page import="javax.mail.internet.MimeMessage" %> <%@ page import="javax.mail.internet.InternetAddress" %> <%@ page import="javax.mail.Transport" %> <%@ page import="javax.mail.MessagingException" %> <%@ page import="org.apache.commons.logging.Log"%> <%@ page import="org.apache.commons.logging.LogFactory"%> <% Log log = LogFactory.getLog(Object.class); String smtpServerHost = "localhost"; String adminEmailSubject = "[IslamicSpeakers.ca - Comment/Question]"; String adminEmailAddress = "okhan@islamicspeakers.ca"; String adminEmailFrom = "okhan@islamicspeakers.ca"; // Deterine if registration information is being posted. String action = request.getParameter("action"); if ((action != null) && (action.equalsIgnoreCase("submit"))) { String name = request.getParameter("name"); String email = request.getParameter("email"); String phone = "(" + request.getParameter("phoneAreaCode") + ") " + request.getParameter("phoneExchange") + " - " + request.getParameter("phoneLocal"); String subject = request.getParameter("subject"); String commentQuestion = request.getParameter("comment"); // Retreive a connection to the SMTP server Properties mailServerProperties = System.getProperties(); mailServerProperties.put("mail.host", smtpServerHost); // mailServerProperties.put(); Session mailSession = Session.getInstance(mailServerProperties, null); // Create Administrator Message try { Message adminMsg = new MimeMessage(mailSession); adminMsg.setFrom(new InternetAddress(adminEmailFrom)); adminMsg.setRecipient(Message.RecipientType.TO, new InternetAddress(adminEmailAddress)); adminMsg.setSubject(adminEmailSubject + " - " + subject); String adminMessageBody = "Assalaam Alaykum,\n" + "The following person has submitted a comment/question from our website:\n" + "\n" + "Contact Information\n" + "--------------------------------\n" + "Name: " + name + "\n" + "Email Address: " + email + "\n" + "Phone Number: " + phone + "\n" + "\n" + "Comment/Question\n" + "--------------------------------\n" + commentQuestion + "\n" + "\n" + "Wasalaam Alaykum,\n" + "- ISB Vancouver Website"; adminMsg.setText(adminMessageBody); Transport tr = mailSession.getTransport("smtp"); tr.connect("localhost", "isbadmin_omar", "@m@n@h123"); tr.send(adminMsg); // Send Email } catch (MessagingException me) { log.error("[ISB Vancouver - Comment/Question ] encountered a Messaging Exception = " + me.toString()); } catch (Exception e) { log.error("[ISB Vancouver - Comment/Question Form] encountered an exception = " + e.toString()); } } %>