Last active
December 11, 2015 17:48
-
-
Save pziecina/4636800 to your computer and use it in GitHub Desktop.
How to send email from cmd line
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #source: http://www.debianadmin.com/how-to-sendemail-from-the-command-line-using-a-gmail-account-and-others.html | |
| #--help is very helpful | |
| #simple - message from file | |
| sendEmail -f my.account@gmail.com -t recipient1@domain.tld \ | |
| -u "this is the test tile" -m "this is a test message" \ | |
| -a /mnt/storage/document.sxw "/root/My Documents/Work Schedule.kwd" | |
| -s smtp.gmail.com:587 \ | |
| -xu my.account -xp mypasswd | |
| #simple - message from stream | |
| grep ERROR service.log | sendEmail -f my.account@gmail.com -t recipient1@domain.tld \ | |
| -u "this is the test tile" -m "this is a test message" \ | |
| -s smtp.gmail.com:587 \ | |
| -xu my.account -xp mypasswd | |
| #more complex | |
| sendEmail -f my.account@gmail.com -t recipient1@domain.tld recipient2@otherdomain.tld \ | |
| -cc user2@isp.net tom@isp.net jess@isp.net \ | |
| -bcc user2@isp.net tom@isp.net jess@isp.net \ | |
| -u "this is the test tile" -m "this is a test message" \ | |
| -s smtp.gmail.com:587 \ | |
| -xu my.account -xp mypasswd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment