tags:

views:

247

answers:

1

Hello guys,

I am sending email using Java Mail API. When the email is received in the inbox its shows the email address used to send the email. I want to hide the from email address and show some text. I think its possible because when I get an email from facebook, in the inbox it says "Facebook - Email subject" rather than "[email protected] - Email Subject".

I want to do the same using Java Mail API.

Thanks in advance. :)

+4  A: 

Use the Constructor

InternetAddress(String address, String personal)

when building your sender address. In your example this would be

sender = new InternetAddress("[email protected]","Facebook");
Wolf
That worked, Thanks you so much.
Zaheer Baloch