Getting this error when calling the web API. Error only occurs with certain from email address.
Status Code: Forbidden
I was having the same problem. I discovered that the emails
from of my application and the sender authentication of the SendGrid API need to be the same.
To fix this error you need go to perform SendGrid Sender Authentication for your sender email.
To do this, You need to login to your SendGrid Dashboard and visit Sender Authentication which is under the Settings dropdown.
There are 2 Types of Sender Authentication
- Domain Authentication // recommended
- Single Sender Verification
1 Domain Authentication
IF you allow SendGrid to authenticate your domain e.g.
THEN you will be able to successfully send an email with your SendGrid API KEY if the email
from key matches the verified domain
2 Single Sender Authentication
This is another option where you verify a single email e.g.
Which will then allow you to send out emails
from: email@example.com via your SendGrid API KEY
Settings -> Sender Authentication