Forums

Sending email with Django works locally but not in Production

Hello all, I am using Django and django.core.mail to send a message using EmailMessage() It works well locally, however I deployed to prod today and the email sending feature is not working in PROD.

I am using smtp-mail.outlook.com in order to send the mail. Do you have any ideas why ?

Many thanks for your help,

It might be that the SMTP server is applying stricter security checks when an incoming connection comes from a cloud hosting provider than they do to connections from a normal ISP. The best bet would be to add some logging code to see what it's returning to you.

thanks for the reply,

so in the server log i get the following error:

2018-06-06 14:05:37 (535, b'5.7.3 Authentication unsuccessful [BN6PR06CA0020.namprd06.prod.outlook.com]')

however, I m using the same credentials as in dev env.

Hmm, that's odd. I think you'd be best off getting in touch with their tech support, then -- it's conceivable they've blocked one or more of our IPs...?

Any updates to this? I have same issue

Are you getting the same error as in the OP? Have you tried contacting Outlook tech support as Giles suggested?