Answers for "smtp zoho django"

0

smtp zoho django

from django.core import mail
    mail.send_mail(subject='Hello',
                   message='Body goes here',
                   from_email='[email protected]',
                   recipient_list=['[email protected]'])
                                       
to this:

    from django.core.mail import EmailMessage
    email = EmailMessage(
        subject='Hello',
        body='Body goes here',
        from_email='[email protected]',
        to=['[email protected]'],
        reply_to=['[email protected]'],
        headers={'Content-Type': 'text/plain'},
    )
    email.send()

Other Zoho mail settings:

    EMAIL_HOST = 'smtp.zoho.com'
    EMAIL_HOST_USER = '[email protected]'
    EMAIL_HOST_PASSWORD = 'password'
    EMAIL_PORT = 587
    EMAIL_USE_TLS = True
    EMAIL_USE_SSL = False
Posted by: Guest on May-04-2021

Python Answers by Framework

Browse Popular Code Answers by Language