这是我的代码,它无法在服务器上运行
try
{
NetworkCredential loginInfo = new NetworkCredential("aaa", "aaa.a");
MailMessage msg = new MailMessage();
msg.From = new MailAddress("aaa@gmail.com");
msg.To.Add(new MailAddress("aaa@gmail.com"));
msg.Subject = " new costumer want to meet yue";
msg.Body = TextBox1.Text + "<br />" + TextBox2.Text + "<br/>" + TextBox3.Text + "<br/>" + TextBox4.Text;
msg.IsBodyHtml = true;
SmtpClient client = new SmtpClient("smtp.gmail.com", 587);
client.EnableSsl = true;
client.Credentials = loginInfo;
client.Send(msg);
}
catch (Exception)
{
}