1
I implemented a class for sending password recovery email, but the email is not sent.
Class code sends email:
public static Task EnviaEmail(string email, string assunto, string mensagem)
{
var MinhaMensagem = new SendGridMessage();
MinhaMensagem.AddTo(email);
MinhaMensagem.From = new MailAddress("meuemail", "meunome");
MinhaMensagem.Subject = assunto;
MinhaMensagem.Text = mensagem;
MinhaMensagem.Html = mensagem;
var credenciais = new NetworkCredential("meunomedeusuario", "minhasenha");
var transporteWeb = new Web(credenciais);
if(transporteWeb != null)
{
return transporteWeb.DeliverAsync(MinhaMensagem);
}
else
{
return Task.FromResult(0);
}
}
}
What tests were done? Did you do it on a neutral server? Did you check if it was not considered spam? In the current form it seems that we have no way to even know if it is a programming problem. You have to provide enough information to ensure that the problem can be solved by us here or only you can solve. It may be programming problem and not even be in this stretch. Já fez um [mcve]?
– Maniero