Last active
December 19, 2015 04:28
-
-
Save 130db/5897050 to your computer and use it in GitHub Desktop.
Mail from command line
This file contains 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
# apt-get insall ssmtp | |
# vim /etc/ssmtp/ssmtp.conf | |
~ Start ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
# | |
# Config file for sSMTP sendmail | |
# | |
# The person who gets all mail for userids < 1000 | |
# Make this empty to disable rewriting. | |
root=postmaster | |
# The place where the mail goes. The actual machine name is required no | |
# MX records are consulted. Commonly mailhosts are named mail.domain.com | |
mailhub=smtp.gmail.com:587 | |
# Use TLS | |
UseSTARTTLS=YES | |
# Where will the mail seem to come from? | |
rewriteDomain= | |
# The full hostname | |
hostname=localhost | |
# Are users allowed to set their own From: address? | |
# YES - Allow the user to specify their own From: address | |
# NO - Use the system generated From: address | |
FromLineOverride=YES | |
[email protected] | |
AuthPass=get-your-key-from-2-step-verification | |
~ End ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
# mkdir ~/ssmtp-senders | |
# vim ~/ssmtp-senders/sender | |
~ Start ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
From: [email protected] | |
Subject: Server alert! | |
~ End ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
# echo "The server goes down ..." | cat ~/ssmtp-senders/sender - | ssmtp [email protected] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Seems like it's outdated now