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 [email protected] -t [email protected] \ | |
| -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 [email protected] -t [email protected] \ | |
| -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 [email protected] -t [email protected] [email protected] \ | |
| -cc [email protected] [email protected] [email protected] \ | |
| -bcc [email protected] [email protected] [email protected] \ | |
| -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