I am using the latest SendGrid .NET package (8.0.3) to send e-mails from my ASP.NET Core web app:
public Task SendEmailAsync(string email, string subject, string message)
{
return Send(email, subject, message);
}
async Task Send(string email, string subject, string message)
{
dynamic sg = new SendGridAPIClient(_apiKey);
var from = new Email("noreply@my.domain", "My Name");
var to = new Email(email);
var content = new Content("text/html", message);
var mail = new Mail(from, subject, to, content);
await sg.client.mail.send.post(requestBody: mail.Get());
}
It works locally, but running on an Azure App Service instance the mails don't come through.
The code runs fine without any exceptions so I have little to work with, but I am thinking it could be some sort of firewall issue.
Has anyone experienced similar issues? How do I go about to debug this?