Django is unable to send email out.
But https://www.smtper.net/ was able to send a test email with same exact settings, user, pass.
What do I need do more in django to send email out?
settings.py
## #environment variables from .env.
from dotenv import load_dotenv
load_dotenv()
NOREPLYEMAIL = os.getenv('NOREPLYEMAIL')
NOREPLYEMAILPASS = os.getenv('NOREPLYEMAILPASS')
### Email config
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
EMAIL_HOST = 'smtppro.zoho.com'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_USER = NOREPLYEMAIL
EMAIL_HOST_PASSWORD = NOREPLYEMAILPASS
DEFAULT_FROM_EMAIL = NOREPLYEMAIL
view.py
# using https://docs.djangoproject.com/en/5.0/topics/email/
@csrf_protect
def test(request):
testemail = EmailMessage(
"Hello", #subject
"Body goes here", #message body
NOREPLYEMAIL, #from
["[email protected]",], #to
reply_to=[NOREPLYEMAIL],
headers={"Message-ID": "test"},
)
testemail.send()