I had everything set up and running. Yesterday no issues. And to day I am getting "Connection unexpectedly closed".
gmail_password = 'password'
email_text = MIMEMultipart()
email_text['From'] = "All Awaken"
email_text['Subject'] = "Contact Form"
message = "Message"
email_text.attach(MIMEText(message))
server = smtplib.SMTP('smtp.zoho.eu', 587)
server.starttls()
server.login(gmail_user, gmail_password)
server.sendmail(gmail_user, email, email_text.as_string())
server.quit()
Here is the log:
>>> server.login(gmail_user, gmail_password)
(235, 'Authentication Successful')
>>> server.sendmail(gmail_user, email, email_text.as_string())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/smtplib.py", line 751, in sendmail
self.rset()
File "/usr/lib/python2.7/smtplib.py", line 470, in rset
return self.docmd("rset")
File "/usr/lib/python2.7/smtplib.py", line 395, in docmd
return self.getreply()
File "/usr/lib/python2.7/smtplib.py", line 369, in getreply
raise SMTPServerDisconnected("Connection unexpectedly closed")
smtplib.SMTPServerDisconnected: Connection unexpectedly closed
My ports both on the server and on this machine that I am using (465, 587) are opened.
I have tried using the SMTP_SSL and I am getting the same error.
Please help.