Send mail from Oracle Solaris OS with attached files
To send mail from Solaris, use this syntax
echo "some text to send" | mailx -s "subject of email" recipient's@address
Or, if you have body of email in some file:
mailx -s "subject of email" recipient's@address < some_file.txt
If you want to send mails with zip files of image files use the following formats:
uuencode reports.tar.gz reports.tar.gz | mailx -s "My Report" you@domain.com
uuencode office.jpeg office.jpeg | mail -s "Subject" you@domain.com
If you need to send multiple attachments in single mail:
$ uuencode r1.tar.gz r1.tar.gz > /tmp/out.mail
$ uuencode r2.tar.gz r3.tar.gz >> /tmp/out.mail
$ uuencode r3.tar.gz r3.tar.gz >> /tmp/out.mail
$ cat email-body.txt >> /tmp/out.mail
$ mail -s "Reports" you@domain.com < /tmp/out.mail
Comments
Post a Comment