S
Shane Jaworski
Here is a example
<%@ page import="java.sql.*" %>
<%@ page import="java.util.*" %>
<%@ page import="javax.mail.*" %>
<%@ page import="javax.mail.internet.*" %>
<%
String toemail = "";
String fromemail = "";
String last_email = "";
Properties props = new Properties();
props.put("mail.smtp.host", mailserver);
last_email = "(e-mail address removed)";
to_email = "(e-mail address removed)";
fromemail = "(e-mail address removed)";
toemail = toemail + "," + last_email;
Session mailSession = Session.getInstance(props, null);
Address fromUser = new InternetAddress(fromemail);
Address anotherUser = new InternetAddress(last_email);
Address[] toUser = InternetAddress.parse(toemail);
//Address toUser = new InternetAddress(toemail);
Message body = new MimeMessage(mailSession);
body.setRecipients(Message.RecipientType.TO, toUser);
body.setRecipient(Message.RecipientType.CC, fromUser);
body.setFrom(fromUser);
body.setSubject("Lots of Stuff.");
body.setContent("Sent: " + new java.util.Date() + "\n\nPlease respond
to this request as soon as possible.\n\n", "text/plain");
Transport.send(body);
%>
<%@ page import="java.sql.*" %>
<%@ page import="java.util.*" %>
<%@ page import="javax.mail.*" %>
<%@ page import="javax.mail.internet.*" %>
<%
String toemail = "";
String fromemail = "";
String last_email = "";
Properties props = new Properties();
props.put("mail.smtp.host", mailserver);
last_email = "(e-mail address removed)";
to_email = "(e-mail address removed)";
fromemail = "(e-mail address removed)";
toemail = toemail + "," + last_email;
Session mailSession = Session.getInstance(props, null);
Address fromUser = new InternetAddress(fromemail);
Address anotherUser = new InternetAddress(last_email);
Address[] toUser = InternetAddress.parse(toemail);
//Address toUser = new InternetAddress(toemail);
Message body = new MimeMessage(mailSession);
body.setRecipients(Message.RecipientType.TO, toUser);
body.setRecipient(Message.RecipientType.CC, fromUser);
body.setFrom(fromUser);
body.setSubject("Lots of Stuff.");
body.setContent("Sent: " + new java.util.Date() + "\n\nPlease respond
to this request as soon as possible.\n\n", "text/plain");
Transport.send(body);
%>