朝、なぜこのコードが機能しないのか理解できません!ありがとう、awnsersを待っています:)
protected void Enviar_Click(object sender, EventArgs e)
{
var pass = new NetworkCredential();
pass.UserName = "myuser@gmail.com";
pass.Password = "password";
var smtpClient = new SmtpClient();
smtpClient.Port = 587;
smtpClient.Host = "smtp.gmail.com";
smtpClient.Credentials = pass;
smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;
smtpClient.EnableSsl = true;
smtpClient.UseDefaultCredentials = false;
var email = new MailMessage(pass.UserName, "myname@mywork.com.br", txtsubject.Text,
"name : " + txtname.Text + "menssage : " + txtMessage.Text);
SMTP.Enviar(email);
}