发送邮件的from 是哪里来的啊?随便写的吗?还是设置邮件服务器时制定的?请给出的答案详细一些。。3Q!!!

解决方案 »

  1.   

    当然不是了,邮件服务都需要验证的.你在发送邮件时要指定发from
    public void SendMailLog(string sourceName, string message)
      {
       MailMessage newMail = new MailMessage();
       newMail.Subject = sourceName;
       newMail.From="**@sina.com";
       newMail.To = "**@sina.com";
       newMail.Body = message;
       newMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //basic authentication
       newMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "******"); //set your username here
       newMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "*****"); //set your password here
       newMail.Priority=MailPriority.High;
       SmtpMail.SmtpServer = "smtp.sina.com.cn";
       SmtpMail.Send(newMail);
      }
      

  2.   

    http://anhr.cnblogs.com/archive/2006/04/13/373960.htmlHope this helps
      

  3.   

    Thanks all
    我要做的是内网发送
    外网的我已经做好了
    内网发信 会报一个异常 :  CDO.Message 错误
    我也不知道内网的SMTP服务怎么设置  
    还有他的POP3邮件服务器怎么设置 在代码级别  我调用SmtpMail.SmtpServer = "这里写哪个服务器?是写SMTP虚拟服务的?还是写POP3的 我不是很清楚,再就是内网需要加上newMail.Fields.Add()里面的属性吗?";请各位朋友作答谢谢