Sending email such that "from" is a name or text rather than real email address
jakarta-mail, java
Solution
Use the Constructor
InternetAddress(String address, String personal)
when building your sender address. In your example this would be
sender = new InternetAddress("xyz@facebook.com","Facebook");
Problem
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 "xyz@facebook.com - Email Subject". I want to do the same using Java Mail API. Thanks in advance. :)