1

I have configured sSMTP on Ubuntu and it worked fine yesterday. But today when I am trying to send email it shows "ssmtp: Cannot open smtp.gmail.com:587" error message.

$ apt-get install ssmtp  

$ vi /etc/ssmtp/ssmtp.conf
root=sender.email@gmail.com
mailhub=smtp.gmail.com:587
rewriteDomain=
hostname=mycomputerName
UseTLS=YES
UseSTARTTLS=YES
AuthMethod=LOGIN
AuthUser=sender.email@gmail.com
AuthPass=sender.email.password
FromLineOverride=YES

$ chmod 640 /etc/ssmtp/ssmtp.conf

$ ssmtp username@gmail.com
Hi
Ctrl+D
ssmtp: Cannot open smtp.gmail.com:587

Additional info: Yesterday I used public IP, today I am using private IP. I think it is not any problem.

mgorven
  • 30,615
  • 7
  • 79
  • 122
Jerry
  • 179
  • 2
  • 8
  • 20
  • 3
    Your machine can't connect to smtp.gmail.com on port 587, so something must be blocking it. Check any firewalls on the machine or between the machine and the Internet. – mgorven Aug 09 '12 at 05:33

1 Answers1

-1

I had the same problem (in my raspberry), but things changed from one day to another. I mean my ssmtp work fine for months and one day it stopped with the same error of your. I don't know why and what is the cause but after some attempts I added the AuthMethod in my ssmtp.conf and it worked. Now the file look like this:

root=myemail@gmail.com
mailhub=smtp.gmail.com:587
rewriteDomain=gmail.com
hostname=YourComputerHostName
UseTLS=YES
UseSTARTTLS=YES
AuthUser=myemail@gmail.com
AuthPass=passwordofmyaccount
AuthMethod=LOGIN
FromLineOverride=YES

Try copy and paste changing your email, password and raspberry name. Hope it work

Andrea
  • 1