User Tools

Site Tools


Send basic e-mail with mail(1)

Send e-mail in shell scripts

mail(1) usage:

-s subject 	Use subject for the e-mail title
-c address 	Send copy of the mail to the specified address
-b address 	Send blind carbon copy to specified address

Send a file to root:

$ mail -s "TODO list" root < todo.log

Attach files with uuencode(1)

Send a binary file:

$ uuencode brimbelle.jpeg brimbelle.jpeg | mail

Send multiple files:

(cat text_to_send.txt ; uuencode brimbelle.jpeg brimbelle.jpeg) | mail
tips/openbsd/mailcommand.txt · Last modified: 2011/03/14 17:48 by mattieu