Hey was wondering if anybody could help me i'm trying to set up javamail so that i can send out mailing lists from my website, here's the code i have what do i need to change???
<%@ page import="java.util.*, javax.mail.*, javax.mail.internet.*" %>
<%
Properties props = new Properties();
props.put("mail.smtp.host", "hoth.compsoc.com");
Session s = Session.getInstance(props,null);
MimeMessage message = new MimeMessage(s);
InternetAddress from = new InternetAddress("sanz@eircom.net");
message.setFrom(from);
//String toAddress = request.getParameter("to");
//InternetAddress to = new InternetAddress(toAddress);
//message.addRecipient(Message.RecipientType.TO, to);
String strName = /* request.getParameter("to"); */
InternetAddress[] address = InternetAddress.parse(strName);
message.setRecipients(Message.RecipientType.TO, address);
String subject = request.getParameter("subject");
message.setSubject(subject);
String text = request.getParameter("text");
message.setText(text);
Transport.send(message);
%>
<html>
<p align="center">The Message has been sent.<br>Check your inbox.</p>
<p align="center"><a href="Mail.html">Click here to send another!</a></p>
</html>
Thanks a mill
Sanz