Reputation: 33
I am doing everything as it is shown in sendgrid's documentation
var client = new SendGridClient(apiKey);
var from = new EmailAddress("[email protected]", "Example User");
var subject = "Sending with SendGrid is Fun";
var to = new EmailAddress("[email protected]", "Example User");
var plainTextContent = "and easy to do anywhere, even with C#";
var htmlContent = "<strong>and easy to do anywhere, even with C#</strong>";
var msg = MailHelper.CreateSingleEmail(from, to, subject, plainTextContent, htmlContent);
var response = await client.SendEmailAsync(msg);
Console.WriteLine(response.StatusCode);
Upvotes: 0
Views: 556
Reputation: 33
'From' mail should be registered in SendGrid as a verified sender. Settings -> Sender Authentication.
Upvotes: 1