Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node JS: Sendgrid Mail 403 'Forbidden' error

I am sending a very straightforward email using Send grid in my node js project. But I get returned a 403 Forbidden error. The API Key has full access. The code is also correctly integrated, as I used another API Key from another account and it works perfectly.

Error log:

enter image description here

Any suggestions?

like image 665
iqra Avatar asked Apr 10 '20 21:04

iqra


People also ask

How do I fix Error 403 Forbidden in Gmail?

Resolve a 403 error: User rate limit exceeded To fix this error, try to optimize your application code to make fewer requests or retry requests. For information on retrying requests, refer to Retry failed requests to resolve errors. For additional information on Gmail limits, refer to Usage limits.

What does request failed forbidden 403 mean?

The HTTP 403 Forbidden response status code indicates that the server understands the request but refuses to authorize it.


1 Answers

The error exists as the email address in the "from" field in the message(in your nodejs code,, to be sent using sendgrid) is not verified by sendgrid. Only put that email address in the "from" field which is explicitely verified by sendgrid.

To verify your sender email address to be able to send emails, refer to the link below:-

https://sendgrid.com/docs/ui/sending-email/sender-verification

Hope this helps.

(There could be further issues regarding domain name, read the link properly, they have a warning regarding use of gmail.com addresses, you can ignore that)

like image 93
Aman Chawla Avatar answered Sep 27 '22 19:09

Aman Chawla