Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javamail: sending to multiple recipients.

Status
Not open for further replies.

alsaunde

Programmer
Dec 7, 2001
6
CA
I have Javamail working as far as sending mail goes, but I am unable to get it to send to more than one recipient.

I tried the following:

InternetAddress[] to = InternetAddress.parse((String)to);

where 'to' is equal to "bob@bob.net,bob2@bob.net".

If I just have 1 email address in the String 'to' it will send, but if I try and give it a comma seperated list it will not.

I don't know whether it is a formatting issue or I am just not calling the parse method properly.

Any help would be appreciated.

Thanks,

Al
 
According to RFC822, strings with @ in them must be quoted. The parse command without the "false" parameter is supposed to adhere to most of those rules. Try doing this and see if it works:

"bob@bob.net","bob2@bob.net"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top