-1
0
#!/bin/bash
SMTPTO=akshaysingh@gmail.com
SMTPFROM=akshaysingh1@gmail.com
SMTPSERVER=smtp.googlemail.com:587
SMTPUSER=akshaysingh
SMTPPASS=password
MESSAGE="123"
SUBJECT="THIS IS END."
sendemail -f $SMTPFROM -t $SMTPTO -u $SUBJECT -m $MESSAGE -s $SMTPSERVER -xu $SMTPUSER -xp $SMTPPASS -o tls=yes
It's giving the error:
sendemail[3854]: ERROR => Connection attempt to smtp.googlemail.com:587 failed: IO::Socket::INET6: connect: Connection refused
i also install sendEmail pckage – akshay singh – 2015-09-08T19:41:47.700
"If you tried configuring your SMTP server on port 465 (with SSL) and port 587 (with TLS), but are still having trouble sending mail, try configuring your SMTP to use port 25 (with SSL). " – DavidPostill – 2015-09-08T19:46:20.923
Problems sending mail with POP or IMAP – DavidPostill – 2015-09-08T19:47:55.897
1
Doesn't smtp.googlemail.com need a complete e-mail address as username? So SMTPUSER=akshaysingh@gmail.com or something? And did you set the "Allow less secure apps access" to ON in https://myaccount.google.com/security (all the way at the bottom of that page) or at https://www.google.com/settings/security/lesssecureapps directly? (Don't forget to set it back if it doesn't help)
– Rik – 2015-09-08T19:47:58.587