I am sending mail with Java mail and an SMTP server. I want to be able to change the \"name\" that the recipient sees when they get an email message - not simply the prefix of t
You need to change:
message.setFrom(new InternetAddress(FROM));
to
message.setFrom(new InternetAddress(FROM, "Company XYZ"));
Documentation: Class InternetAddress
InternetAddress
public InternetAddress(String address, String personal) throws UnsupportedEncodingException
Construct an InternetAddress given the address and personal name. The address is assumed to be a syntactically valid RFC822 address.
Parameters:
address - the address in RFC822 format
personal - the personal name
Throws: UnsupportedEncodingException