jQuery in Action, 2nd edition*
The moose likes Servlets and the fly likes java mail:How to send CC & BCC? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "java mail:How to send CC & BCC?" Watch "java mail:How to send CC & BCC?" New topic
Author

java mail:How to send CC & BCC?

Anithavin
Greenhorn

Joined: May 03, 2001
Posts: 2
How do i send mail to multiple recipients using CC and BCC in java mail??
Alvin de Jesus
Greenhorn

Joined: May 05, 2001
Posts: 3
This can be done by doing:
message.setRecipients(Message.RecipientType.CC, CC);
message.setRecipients(Message.RecipientType.BCC, BCC);
I hope this helps!
Anithavin
Greenhorn

Joined: May 03, 2001
Posts: 2
InternetAddress[] address1 = {new InternetAddress();address1.parse(request.getParameter("cc"))};
newMessage.setRecipients(Message.RecipientType.BCC, address1);
I used this !even then it doesn't work!
Maky Chopra
Ranch Hand

Joined: Apr 11, 2001
Posts: 149
Anithavin,
The javaranch has a naming policy and your login name does not meet the requirement.
Please signup again with a proper name.
Thanks..
Jayson Falkner
Author
Ranch Hand

Joined: May 07, 2001
Posts: 57
Originally posted by Anithavin:
How do i send mail to multiple recipients using CC and BCC in java mail??

You can also use a custom tag library to do this easily with JSP. Here is a free one that uses the JavaMail API
http://www.jspinsider.com/jspkit/javamail/jspkit_javamail.html
Source code is included if you wish to tinker.
Jayson Falkner
V.P./CTO, Amberjack Software LLC
Jayson@jspinsider.com www.jspinsider.com


Jayson Falkner<br />jayson@jspinsider.com<br />Author of <a href="http://www.jspbook.com" target="_blank" rel="nofollow">Servlets and JavaServer Pages; the J2EE Web Tier</a>
 
Don't get me started about those stupid light bulbs.
 
subject: java mail:How to send CC & BCC?
 
Similar Threads
JavaMail - 554 Relay rejected for policy reasons.
Limit of address fieldin Java Mail API
bulk mail and bulk sms
sending mail to multiple receipients
EMail servlet