using System.Web.Mail;
myMail.From = "[email protected]";
myMail.To = "[email protected]";
myMail.Subject = "MailTest";
myMail.Priority = MailPriority.Low;
myMail.BodyFormat = MailFormat.Text;
myMail.Body = "Test";

SmtpMail.SmtpServer = "mail.163.com";
SmtpMail.Send(myMail);

解决方案 »

  1.   

    163的服务器可是需要身份验证的,
    using System.Web.Mail;myMail.To = "[email protected]";
    myMail.Subject = "MailTest";
    myMail.Priority = MailPriority.Low;
    myMail.BodyFormat = MailFormat.Text;
    myMail.Body = "Test";

    SmtpMail.SmtpServer = "localhost";
    SmtpMail.Send(myMail);建议你用jmail,webeasymail,cdo等。
      

  2.   

    用using System.Web.Mail只有在程序所在服务器上安装smtp服务了
      

  3.   

    该服务器需要身份验证,但是微软的Framework里面没有提供身份验证的smtp类!
      

  4.   

    你是没有验证,如果这样做,就能发出去了.我刚做完没有问题的.
    private void Page_Load(object sender, System.EventArgs e) 

    MailMessage mail = new MailMessage(); 
    mail.To = "[email protected]"; 
    mail.From = "[email protected]"; 
    mail.Subject = "this is a test email."; 
    mail.Body = "Some text goes here"; 
    mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //basic authentication 
    mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "my_username_here"); //set your username here 
    mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "super_secret"); //set your password here SmtpMail.SmtpServer = "mail.mycompany.com"; //your real server goes here 
    SmtpMail.Send( mail ); 
      

  5.   

    用jemil吧!去下载一个w3JMail43Personal.exe,安装好后在程序导入jemil.dll(在w3JMail43Personal.exe安装目录下面有的)using jmail;
    using System.Web.Util;
    using System.Web.Mail;
    Message jmailobj=new Message();
    jmailobj.Logging=true;
    jmailobj.Silent=true;
    jmailobj.MailServerUserName="8888"; //发信邮件服务器的帐号
    jmailobj.MailServerPassWord="8888"; //密码
    jmailobj.Body="ok";
    jmailobj.Charset="gb2312"; 
    jmailobj.Subject="这个是JMAIL测试!";
    jmailobj.From="[email protected]";
    jmailobj.FromName="test";
    jmailobj.AddRecipient("[email protected]","Name","A"); //收件人地址
    jmailobj.Priority =1;
    if(jmailobj.Send("smtp.163.com",false)) 
    {
    Response.Write("ok"); 
    }
    else 
    {
    Response.Write("false");
    }
    注意 可能还跟杀毒软件有关,要关了杀毒软件防火墙之类的东西!
      

  6.   

    http://huolx.t2008.com/article.asp?articleid=1
    我用C#写的支持smtp验证的邮件组件,
      

  7.   

    加上:
    mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //basic authentication 
    mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "my_username_here"); //set your username here 
    mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "super_secret"); //set your password here