How can I change displayed name as sender?
Emily Wong
I send email from my server like this:
echo "This is the body of the email" | mail -s "This is the subject line" Noted that I replace with a real email address. And it works. Just I need to know, where this nickname comes from?
I use ubuntu 14.04 on the server and I want to know how can I change that name?
2 Answers
Don't use mail, there are better command-line MUAs, such as mailx (package bsd-mailx) or mutt.
mailx will do what you want with the -r flag:
echo Test. | mailx -r "Joe Sender <>" -s Test You can likewise specify a display name for the recipient, by the way.
The nickname shown in for instance gmail.com comes from the part of the From field that is outside <>, so in this example it would be Joe Sender.
Using mail, you can set the username using the proper syntax, such as echo "Test" | mail -a "From: Someone <>" .