System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient("myserverIP", port:110);
System.Net.NetworkCredential SMTPUserInfo = new System.Net.NetworkCredential("username", "password");
client.UseDefaultCredentials = false;
client.Credentials = SMTPUserInfo;
client.Send("mailfrom", "mailto1,mailto2", "mailsubject", "mailBody")
或者
System.Net.Mail.SmtpClient client = new SmtpClient("myserverIP", 25);
System.Net.NetworkCredential SMTPUserInfo = new NetworkCredential("username", "password");
System.Net.Mail.MailMessage msg = new MailMessage();
msg.To.add(strTo);
msg.Bcc.add(strBCC);
msg.Subject = strSubject;
msg.Body = strBody;
System.Net.Mail.MailAddress from = new MailAddress("webmaster@netlist.com");
msg.From = from;
client.UseDefaultCredentials = false;
client.Credentials = SMTPUserInfo;
client.Send(msg);