title: ZOHO smtp SMTPAuthenticationError at / (535, 'Authentication Failed') Django app
body: <p>I am trying to establish a connection via shell on the VPS with this code:  </p>
  
  <pre><code>import smtplib
  from email.mime.text import MIMEText
  
  
  sender = 'my zoho email'
  recipient = 'my gmail account email'
  
  
  msg = MIMEText("Message text")
  msg['Subject'] = "Sent from 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', '*********')
  </code></pre>
  
  <p>All the credentials are correct, since I am login in successfully to my account at <a href="https://www.zoho.eu/mail/" rel="nofollow noreferrer">https://www.zoho.eu/mail/</a></p>
  
  <p>When i try to login with:</p>
  
  <pre><code>server.login('my zoho account email', '*********')
  </code></pre>
  
  <p>I get SMTPAuthenticationError and the stack trace shows:</p>
  
  <pre><code> self.connection.login(force_str(self.username), force_str(self.password)) 
   ...
   raise SMTPAuthenticationError(code, resp)
  </code></pre>
  
  <p>my settings.py is:</p>
  
  <pre><code>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 = '*********'
  </code></pre>
  
  <p>There are numerous threads about this on the web but, not even one has an answer about it. Their support doesn't answer for third day now...</p>
  
  <p>I am using NGINX and the default configuration is not set for https:// but my custom configuration is and the website is running over https://.</p>
  
  <p>Edit: If I try to connect over port 587 with:</p>
  
  <pre><code>server = smtplib.SMTP_SSL('smtp.zoho.com', 587)
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>SSLError: [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:590)
  </code></pre>