zoho mail django/python settings

how to use zoho mail with your django/python
video version: video_link

To use Zoho Mail as your email backend in Django or Python, you need to configure the SMTP settings accordingly.

EMAIL_HOST = "smtp.zoho.com"
EMAIL_HOST_USER = "[email protected]"
DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
# password generated from zoho mail app password after enabling 2fa
EMAIL_HOST_PASSWORD = "fZRGnLzGesdfsdfuXX"
EMAIL_PORT = 465
EMAIL_USE_SSL = True

if using smtplib then

import smtplib
from email.mime.text import MIMEText

# Define to/from
sender = '[email protected]'
recipient_list = '[email protected],[email protected],[email protected]'

for recipient in recipient_list.split(","):
    recipient = recipient.strip()

# Create message
    msg = MIMEText("Message text")
    msg['Subject'] = "Sent from pythonmmm"
    msg['From'] = sender
    msg['To'] = recipient

    # Create server object with SSL option
    server = smtplib.SMTP_SSL('smtp.zoho.com', 465)

    # Perform operations via server
    server.login('[email protected]', 'fZRGnLzGeuXX')
    server.sendmail(sender, [recipient], msg.as_string())
    server.quit()