I recently needed to set an alias for FROM email address when I was sending an email via JavaMail (i.e. when the receipient opens up his email, I didn’t want the FROM email to show up as ivetic@xxxx.com, but I wanted them to see it as “Aleks Ivetic” instead).
If you try to do pass “Aleks Ivetic” directly as FROM field, you will get this error: javax.mail.internet.AddressException: Illegal whitespace in address in string ” Aleks Ivetic
You should format the FROM field like this instead: “Aleks Ivetic<aleksivetic@xxxxx.com>”