发送电子邮件与联系表格asp.net
答
MailMessage mail = new MailMessage();
SmtpClient SmtpServer = new SmtpClient("your.mail.server");
mail.From = new MailAddress("[email protected]");
mail.To.Add("[email protected]");
mail.Subject = "Test Mail";
mail.Body = "This is for testing SMTP mail";
SmtpServer.Credentials = new System.Net.NetworkCredential("username", "password");
SmtpServer.Send(mail);
是。这将做到这一点。 :)虽然,有时您可能还需要手动添加端口。 – 2011-02-19 05:43:09