Skip to content

Instantly share code, notes, and snippets.

@130db
Last active December 19, 2015 04:28
Show Gist options
  • Save 130db/5897050 to your computer and use it in GitHub Desktop.
Save 130db/5897050 to your computer and use it in GitHub Desktop.
Mail from command line
# 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]
@130db
Copy link
Author

130db commented Sep 15, 2013

Seems like it's outdated now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment