>> Seong Y. Kim <[EMAIL PROTECTED]> wrote:
>> >I need to write a servlet which sends an email msg to multi-users. I am
>> >thinking of sending them one by one using sun.net.smtp.SmtpClient
object.
>> The
>> >fact is that I am new in sending email stuff. Is this a good idea? If
>> yes,
>> >can you tell me how to do it? If no, can you tell me the better way to
do?
>>
>> I would suggest using EasyMail. It's a very easy-to-use package for
sending
>> mail. It's completely free, and the source is available. You can get it
>> from:
>>
>> <http://www.rule-of-eight.com/components/easymail/>
>>
>> The code would look something like this:
>>
>> mail = MailPack.newEmailMessage( "smtpserver.itt.com" );
>> mail.setSender( "[EMAIL PROTECTED]" );
>> mail.addRecipient( "[EMAIL PROTECTED]" );
>> mail.addRecipient( "[EMAIL PROTECTED]" );
>> mail.addRecipient( "[EMAIL PROTECTED]" );
>> mail.addRecipient( "[EMAIL PROTECTED]" );
>> mail.setSubject( "I am the walrus" );
>> mail.setContent( "Coo coo cachoo." );
>> mail.send();
>
>Seong Y. Kim <[EMAIL PROTECTED]> wrote:
>Thanks for your suggestion.
>However, what I am concern is if I use easyMail to send to Multi-users, Can
>recipients be able to see other recipients email address? I do not want
that.
You could use:
mail.addBcc( "[EMAIL PROTECTED]" );
...
Except that EasyMail doesn't have an "addBcc()" method. Since it is open
source, you could add that method and roll it back into the source.
Or, you could do this:
String[] addresses = new String[] { "[EMAIL PROTECTED]",
"[EMAIL PROTECTED]", "[EMAIL PROTECTED]", "[EMAIL PROTECTED]" }
for ( int i = 0; i < addresses.length; i++ )
{
mail = MailPack.newEmailMessage( "smtpserver.itt.com" );
mail.setSender( "[EMAIL PROTECTED]" );
mail.addRecipient( addresses[i] );
mail.setSubject( "I am the walrus" );
mail.setContent( "Coo coo cachoo." );
mail.send();
}
That would of course put a heavier load on your SMTP server, but it may be
worth it because the messages will look a bit more normal.
Erik
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html