Posted By:
marg_fritschen
Posted On:
Tuesday, August 14, 2001 06:13 AM
I am trying to do a feedback form using javamail. I followed a artical "Using JSP with JavaMail" by Jayson Falkner, and it was very helpful. Now I need to add some fields to the form and have them returned and aligned on the returned email, and am having trouble with this. I am using the following on the sendmail.jsp <%@ page import="java.util.*, javax.mail.*, javax.mail.internet.*" %> <% Properties props = new Properties(); props.put("mail.smtp.host", "mail.pwgsc.gc.ca"); Session s = Session.getInstance(props,null); MimeMessage message = new MimeMessage(s); InternetAddress from = new InternetAddress("mark.fritschen@pwgsc.gc.ca"
More>>
I am trying to do a feedback form using javamail. I followed a artical "Using JSP with JavaMail" by Jayson Falkner, and it was very helpful. Now I need to add some fields to the form and have them returned and aligned on the returned email, and am having trouble with this.
I am using the following on the sendmail.jsp
<%@ page import="java.util.*, javax.mail.*, javax.mail.internet.*" %>
<%
Properties props = new Properties();
props.put("mail.smtp.host", "mail.pwgsc.gc.ca");
Session s = Session.getInstance(props,null);
MimeMessage message = new MimeMessage(s);
InternetAddress from = new InternetAddress("mark.fritschen@pwgsc.gc.ca");
message.setFrom(from);
InternetAddress to = new InternetAddress("mark.fritschen@pwgsc.gc.ca");
message.addRecipient(Message.RecipientType.TO, to);
String subject = request.getParameter("subject");
message.setSubject(subject);
String text = request.getParameter("text");
message.setText(text);
String phone = request.getParameter("phone");
message.setText(phone);
String lName = request.getParameter("lName");
message.setText(lName);
Transport.send(message);
%>
and on the feedback.jsp page
<<Less