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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using recipient's name instead of email address in to: and from: fiel

Status
Not open for further replies.

xxxJohnnyBlaze

Programmer
Jun 1, 2001
3
0
0
US
Hi,

I am using the mail api.

given: name - Johnny Blaze
email - JohnnyBlaze@EE.com

I am setting the "to" property to the email address(JohnnyBlaze@EE.com) and that is what's being displayed
on the email that is received - "To: JohnnyBlaze@EE.com". Is there a way to display the name of the
recipient in the to: field instead of the email address? ie. instead of "To: JohnnyBlaze@EE.com" I
would like it to be "To: Johnny Blaze".

Below is the code that I am using to set the to: property of the message.
******** start of code *******************

Message msg = new MimeMessage(session);
msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(to));


******** end of code **********************


- johnny
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top