Ésta es mi Web.config:C# - No se puede enviar correo en Windows Azure a través de Gmail SMTP
<system.net>
<mailSettings>
<smtp deliveryMethod="Network">
<network defaultCredentials="true" enableSsl="true" host="smtp.gmail.com" port="25" userName="[email protected]" password="xxxxxxxxxxx"/>
</smtp>
</mailSettings>
</system.net>
Mi método:
public static void EmailVerification(string email, string nickname)
{
MailAddress from = new MailAddress("xxxxxxxxxxx", "xxxxxxxxxxxx");
MailAddress to = new MailAddress(email);
MailMessage message = new MailMessage(from, to);
message.Subject = "Test";
message.Body = "Test";
SmtpClient client = new SmtpClient();
try
{
client.Send(message);
}
catch(SmtpFailedRecipientException ex)
{
HttpContext.Current.Response.Write(ex.Message);
return;
}
}
Mi fracaso SmtpException:
Failure sending mail.
InnerException:
Unable to connect to the remote server
Lo estoy probando localmente pero supongo que debería funcionar. Tengo que ejecutarlo en Windows Azure, lo intenté y tampoco funcionó. ¿Se me escapa algo?
ver esta pregunta: http://stackoverflow.com/questions/32260/sending-email-in-net-through-gmail/32336#32336 –