日期:2014-05-17  浏览次数:20458 次

关于发邮件的问题,多次尝试,请大家帮帮忙。
The following email header is expected:
Sender: <web@reasonables.com>
Return-Path: <web@reasonables.com>
Received: from iron2.hkstp.org [202.94.235.243] by MAIL.REASONABLES.COM with SMTP;
   Sun, 26 Aug 2012 04:16:05 -0400
Received: from smtp.hkstp.org ([192.168.106.16])
  by iron2.hkstp.org with ESMTP/TLS/DHE-RSA-AES256-SHA; 26 Aug 2012 16:16:12 +0800
Received: from ri (mail01.edm.hkstp.org [202.94.235.148])
by smtp.hkstp.org (8.13.4/8.13.4) with ESMTP id n2M8FW4L031832
for <alan@reasonables.com>; Sun, 26 Aug 2012 16:16:12 +0800
Date: Sun, 26 Aug 2012 16:16:12 +0800
From: John Smith<johnsmith@reasonables.com>
Reply-To:<web@reasonables.com>
To: <hr@reasonables.com>
Subject: Realizing Value from IT Investment

添加邮件标头,貌似我的代码无效。


代码如下:

    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