I am try to connect my workmail to django for sending mail but it not work. Below is my django setting for my workmail.
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.mail.us-east-1.awsapps.com'
EMAIL_PORT = 465
EMAIL_USE_SSL = True
EMAIL_USE_TLS = False
EMAIL_HOST_USER = 'myemail@domain.com'
EMAIL_HOST_PASSWORD = 'password'
For EMAIL_HOST_USER
and EMAIL_HOST_PASSWORD
is just for example. but EMAIL_HOST_PASSWORD
I use the password for login to workmail, so I don't know it correct or not.
And here is the code for sending mail
from django.core.mail import send_mail
...
send_mail(subject, message, from_email, recipient_list, fail_silently=False)
Please help me to give answer or there is anything for me to try.
I got this error
(501, b'5.1.7 Invalid MAIL FROM address provided', 'smtp.mail.us-east-1.awsapps.com')
but I think it error because Django can not connect to the workmail with this credential. But I wonder why I write the code in python it work.Hi, I don't think the connection is the problem. Looking at this documentation page the problem is with the email address. Robin
Thank you for provide that but as the error 5.1.7 The sender's address was syntactically invalid. but why I write the python code it work with the credential or it may have some bug in django, I'm not sure
here is the code