protected void Button1_Click(object sender, EventArgs e)
{
MailMessage message = new MailMessage("test@gmail.com", "test@gmail.com", "header", "detail");
message.IsBodyHtml = true;
SmtpClient client = new SmtpClient("smtp.gmail.com", 587);
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.EnableSsl = true;
client.Credentials = new System.Net.NetworkCredential("test@gmail.com", "1234");
client.Send(message);
Label1.Text = "SuccessFull";
}
这是我收到的错误消息:
服务不可用,关闭传输通道。服务器响应是:服务器忙,关闭传输通道。稍后再试