I have set up mailutils in ubuntu 20.04, I can send an email using the command below
echo 'this is a body' | mail -s 'Test Email' -r [email protected] [email protected]
but the first problem with the above command is that it sends the mail with the name 'Ubuntu', which is my current user, only the sender name is not good in this case, the sender address is the one I specified. (Ubuntu <[email protected]>
).
Then in this second command when I try to send specifying the sender's name:
echo 'this is a body' | mail -s 'Test Email' -r 'SenderName <[email protected]>' [email protected]
In my email inbox it will show the following sender: Ubuntu <SenderName@mainmailserver-1-eu>
How can I change the sender name in mailutils while preserving the sender address?