Re: how do i send bulk mails
Posted By:
John_Zukowski
Posted On:
Monday, March 25, 2002 09:55 PM
Perhaps you should look in the FAQ first for an anwer.
Re: how do i send bulk mails
Posted By:
Alex_Loubyansky
Posted On:
Friday, March 22, 2002 06:24 AM
Salute. Roughly:
try {
Properties props = System.getProperties();
props.put("mail.smtp.host", "xxx.xxx.xxx.xxx");
Session session = Session.getDefaultInstance(props, null);
InternetAddress from = new InternetAddress("fromaddress");
for(Iterator iter=subscribers.iterator(); iter.hasNext();) {
Subscriber subscriber = (Subscriber)iter.next();
InternetAddress to = new InternetAddress(subscriber.getEmail());
MimeMessage message = new MimeMessage(mailSession);
message.setFrom(from);
message.addRecipient
(Message.RecipientType.TO, to);
message.setSubject("subject");
message.setContent(msg, "text/html;charset=ISO-8859-1");
Transport.send(message);
} catch(Exception e) {
// handle exception
}
Is it that you need?
alex