ZOHO smtp SMTPAuthenticationError at / (535, 'Authentication Failed') Django app -
i trying establish connection via shell on vps code:
import smtplib email.mime.text import mimetext sender = 'my zoho email' recipient = 'my gmail account email' msg = mimetext("message text") msg['subject'] = "sent python" msg['from'] = sender msg['to'] = recipient server = smtplib.smtp_ssl('smtp.zoho.com', 465) # perform operations via server server.login('my zoho account email', '*********') all credentials correct, since login in account @ https://www.zoho.eu/mail/
when try login with:
server.login('my zoho account email', '*********') i smtpauthenticationerror , stack trace shows:
self.connection.login(force_str(self.username), force_str(self.password)) ... raise smtpauthenticationerror(code, resp) my settings.py is:
email_backend = 'django.core.mail.backends.smtp.emailbackend' email_use_tsl = true email_port = 465 email_host = 'smtp.zoho.com' email_host_user = '**********' email_host_password = '*********' there numerous threads on web but, not 1 has answer it. support doesn't answer third day now...
i using nginx , default configuration not set https:// custom configuration , website running on https://.
edit: if try connect on port 587 with:
server = smtplib.smtp_ssl('smtp.zoho.com', 587) i get:
sslerror: [ssl: unknown_protocol] unknown protocol (_ssl.c:590)
this setting have in settings.py , enough working.
#email settings email_use_ssl = true email_host = 'smtp.zoho.com' email_port = 465 email_host_user = 'someone@example.com' email_host_password = 'yourpassword' default_from_email = 'someone@example.com' server_email = 'someone@example.com' you can test using quick example django docs.
from django.core.mail import send_mail send_mail( 'subject here', 'here message.', 'from@example.com', ['to@example.com'], fail_silently=false, ) 
Comments
Post a Comment