0
votes

Currently I have been using my licensed outlook email address to send emails in django using the below settings

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_USE_TLS = True
EMAIL_HOST = smtp.outlook.office365.com
EMAIL_PORT = 587
EMAIL_HOST_USER  = '[email protected]'
EMAIL_HOST_PASSWORD = 'Password'

Recently we have setup a new shared mailbox '[email protected]' to replace it with my email but having issues sending emails as it doesn't accepts the credentials (i.e password) and throws an SMTPAuthenticationError exception.

Is it possible to send emails using the shared mailbox over smtp server ? If yes, how can I achieve this in Django ?

2

2 Answers

1
votes

Resolved:

All the email settings in the posted question remain the same. Added the shared mailbox email address to a new variable in settings file:

FROM_EMAIL = "[email protected]"

and updated the 'from_email' argument in send_mail method with the new setting

from django.core.mail import send_mail
from django.conf import settings

send_mail('Subject', 'Message', settings.FROM_EMAIL, ["[email protected]"])
0
votes

The mailbox must have a license allocated to be able to send emails. When sending through SMTP, you must specify the credentials of the shared mailbox, not the credentials of some other user who has access delegate to it.