Using Sendgrid and Azure : 550, b'Unauthenticated senders not allowed'

Nicolas Chevalier 101 Reputation points
2021-10-27T20:12:29.15+00:00

Hi

I am trying to send a password reset email to users.
When trying the App locally, the user can select to reset a pwd if forgotten , input his email into a field and submit, in order to receive an email with a link to reset the password.
Checking into Sendgrid, I can see the activity log that the email has been processed and delivered. So it seems working. The sender is my business email address

However, when trying to do the same passing via azure, on https://XXXXXX.azurewebsites.net/en/password_reset/, I get the following :

SMTPSenderRefused at /en/password_reset/
(550, b'Unauthenticated senders not allowed', 'nicolas@Piepel .com')

in the log I get the following as well:

raise SMTPSenderRefused(code, resp, from_addr)

Any help would be appreciated,
merci
Nicolas

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,685 questions
{count} votes

Accepted answer
  1. Nicolas Chevalier 101 Reputation points
    2021-10-30T16:34:29.65+00:00

    This is solved. I found the solution, it was easy but needed someone else eyes .
    In SendGrid, I named my API key ‘test’, and thought in Azure I should name it the same. However, no, I should have named it the same as in my code: SENDGRID_API_KEY
    For someone with experience a standard approach, but not obvious. Hope this can help other users…

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful