How to mail from command line:
$ mail somewhere@domain.com
Output:
Subject: Hello
Hai,
How are you? Hope so you are fine
Take care
Babai
Vivek
. <Type DOT (.) followed by ENTER KEY>
Cc: <Press ENTER KEY>
You need to type . (dot) to send an email. To send contains of file (such as /tmp/message) as mail body then use following command:
$ mail -s 'Hai' somewhere@domain.com < /tmp/message
Please note that above command will NOT route an email if you do not have properly configured MTA/mail server.
$ mail somewhere@domain.com
Output:
Subject: Hello
Hai,
How are you? Hope so you are fine
Take care
Babai
Vivek
. <Type DOT (.) followed by ENTER KEY>
Cc: <Press ENTER KEY>
You need to type . (dot) to send an email. To send contains of file (such as /tmp/message) as mail body then use following command:
$ mail -s 'Hai' somewhere@domain.com < /tmp/message
Please note that above command will NOT route an email if you do not have properly configured MTA/mail server.
0 Comments