Home > Documentation > Postfix > Sending mail from the shell prompt

Sending mail from the shell prompt

Posted by peter on October 18, 2011

To send a mail from the command prompt use the following command (all in one line):

mail -v -r reply@address.co.za -s “subject goes here” -a /pathto/attachment.txt < /pathto/bodyofmail.txt recipient@destinationaddress.co.za

You may like to use this command in a script, or just from the command prompt as a quick way of e-mailing someone a file

 

The above might differ a little from distro to distro, but the principle is the same.

Comments:

Leave a Reply



(Your email will not be publicly displayed.)

Please type the letters and numbers shown in the image.Captcha CodeClick the image to see another captcha.