I am sending an email through sendgrid Api. I want the details of response recevied from the Api.
Loading
I am sending an email through sendgrid Api. I want the details of response recevied from the Api.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sachin SinghPosted Feb 2, 2023, 12:48 PM
While creating sendgrid API, you must have given an EmailID, the same Email ID should be used in From part, To Email can be anything.
Naimish MakwanaPosted Feb 2, 2023, 12:32 PM
To Get Message ID, you can get it from header.
Check this link : https://docs.sendgrid.com/glossary/what-is-x-message-id#:~:text=The%20X%2DMessage%2DID%20is,when%20sending%20email%20from%20SendGrid.&text=The%20X%2DMessage%2DID%20header,your%20X%2DMessage%2DID.
For IsSuccesStatusCode = False. Please check this.
The error exists as the email address in the "from" field in the message is not verified by sendgrid. Only put that email address in the "from" field which is explicitely verified by sendgrid.
https://stackoverflow.com/a/62375242/3054222
Thanks
Naimish
GopiPosted Feb 2, 2023, 12:01 PM
why IsSuccesStatusCode is returns as false. Also I am getting X-message id. How to get the original message id from X-message id.
Naimish MakwanaPosted Feb 2, 2023, 11:53 AM
Hello Gopi,
In response, it will return.
Body, Headers, StatusCode, IsSuccessStatusCode.
Thanks
Naimish Makwana
Sachin SinghPosted Feb 2, 2023, 11:45 AM
Inside response variable you will get the response