Created
June 4, 2015 02:23
-
-
Save dfrankland/fb842dbe96ef0c1b01b2 to your computer and use it in GitHub Desktop.
Automate Gmail SMTP login to send email via sh script.
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
#!/bin/sh | |
smtpsrv="smtp.gmail.com" | |
smtpport="587" | |
smtpusr="" | |
smtppwd="" | |
username64=$( echo $smtpusr | base64 ) # $( base64_encode $smtpusr ) | |
password64=$( echo $smtppwd | base64 ) # $( base64_encode $smtppwd ) | |
( | |
echo "EHLO localhost"; sleep 3; | |
echo "AUTH LOGIN"; sleep 3; | |
echo "${username64}"; sleep 3; | |
echo "${password64}"; sleep 3; | |
) | openssl s_client -starttls smtp -connect ${smtpsrv}:${smtpport} -crlf -ign_eof |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment