how do i send bulk mails
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Friday, March 22, 2002 01:34 AM

I want to send emails to 1000 people i dont want one member address to be revealed to other.. how could i deal..
if code is provided it could be a help for me.


with regards,
ashok
ashok_telukuntla@hotmail.com

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
About | Sitemap | Contact