日期:2014-05-17 浏览次数:20458 次
public class SendMail
{
public SendMail() { }
public string mail { get; set; }
public string pwd { get; set; }
public SendMail(string _mail,string _pwd)
{
this.mail = _mail;
this.pwd = _pwd;
}
public void SendE_Mail(string[] Addressee)
{
SmtpClient smtp = new SmtpClient("smtp.163.com", 25);//or localhost. Use local IIS SMPT as SMPT server.smtp.
smtp.Credentials = new NetworkCredential(mail,pwd);
for (int i = 0; i < Addressee.Length; i++)
{
MailMessage message = new MailMessage("xx@163.com", Addressee[i], "Subject: Realizing Value from IT Investment", "");
NameValueCollection c = new NameValueCollection();
c.Add("Sender", "<web@reasonables.com>");
c.Add("Return-Path", "<web@reasonables.com>");
c.Add("Received", "from iron2.hkstp.org [202.94.235.243] by MAIL.REASONABLES.COM with SMTP; /r/n/t Sun,&nbs