Skip to content

Instantly share code, notes, and snippets.

@MaxPleaner
Created September 29, 2015 05:39
Show Gist options
  • Save MaxPleaner/1a154434c03f387c7c2b to your computer and use it in GitHub Desktop.
Save MaxPleaner/1a154434c03f387c7c2b to your computer and use it in GitHub Desktop.
send_email function for bashrc
function send_email {
curl --url "smtps://smtp.gmail.com:465" --ssl-reqd \
--mail-from "[email protected]" --mail-rcpt "$1" \
--upload-file $2 --user "[email protected]:$GMAIL_PASSWORD" --insecure
}
# replace symbolic.contrast with your email
# and export GMAIL_PASSWORD
# command line options are <recipient> <mail file>
# i.e. send_email [email protected] mail.txt
From: "Max Pleaner" <[email protected]>
To: "Max Pleaner" <[email protected]>
Subject: This is a test
Hello,
this is an email
Bye!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment