ramoore
asked on
JSP, javamail attachments
Hello, I have a jsp page that includes the javamail snippet below. This works fine, but I need to know how to modify this to include one or more attachments. For example, I have the files;
c:\myFile.txt AND c:\myImage.gif that I would like to include. Any help is appreciated!
<%
Properties props = new Properties();
props.put("mail.host", "mailsrv");
Session s = Session.getInstance(props, null);
MimeMessage message = new MimeMessage(s);
InternetAddress from = new InternetAddress("myweb@too thbrush.co m");
message.setFrom(from);
InternetAddress[] addresses={
new InternetAddress("sammy@you rweb.com") ,
new InternetAddress("greg@hisw eb.com")};
message.setRecipients(Mess age.Recipi entType.TO , addresses);
message.setSubject("MY MAIL TEST);
message.setText("This is my message");
Transport.send(message);
%>
c:\myFile.txt AND c:\myImage.gif that I would like to include. Any help is appreciated!
<%
Properties props = new Properties();
props.put("mail.host", "mailsrv");
Session s = Session.getInstance(props,
MimeMessage message = new MimeMessage(s);
InternetAddress from = new InternetAddress("myweb@too
message.setFrom(from);
InternetAddress[] addresses={
new InternetAddress("sammy@you
new InternetAddress("greg@hisw
message.setRecipients(Mess
message.setSubject("MY MAIL TEST);
message.setText("This is my message");
Transport.send(message);
%>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER