废话不说,具体代码如下:
System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
message.To.Add(this.txtAddress.Text);
message.Subject = "This is the Subject line";
message.From = new System.Net.Mail.MailAddress("From@online.microsoft.com");
message.Body = "This is the message body";
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("172.16.12.29");
smtp.Send(message);
系统命名空间:using System.Net.Mail;
别忘记配置SMTP虚拟服务器。
感觉如果外语可以的话,还是到英文论坛能够更容易收获知识。