Showing posts with label Shell script. Show all posts
Showing posts with label Shell script. Show all posts

Tuesday, July 15, 2014

How to set the From email address for email in command line

If you want that the receiver should get a mail from a particular email id we can use the option of from field, Refer the below example.
  • mail -s "Subject of Mail" recerver@domain.com -- -f  fromfield@domain.com  < /root/content.txt
The double dash stops mail from parsing the -f argument and passes it along to sendmail itself.

content.txt is the file which contains the content to be sent.