如下代码
MailMessage m = new MailMessage();
        m.From = "[email protected]";
        m.To = "[email protected]";
        m.Subject = "test in my computer programming";
        m.Body = "hahha,success";
        SmtpMail.SmtpServer = this.TextBox1.Text;//没有SmtpMail,咋回事
        
SmtpMail.SmtpServer = this.TextBox1.Text;//没有SmtpMail,咋回事呢?

解决方案 »

  1.   

    public void WebMail(string SendAddress,string MailBody,string MailTitle)
      {
       MailMessage mm=new MailMessage();
       mm.To=SendAddress;
       mm.From="<大能光>[email protected]";
       mm.Subject=MailTitle;
       mm.BodyFormat=MailFormat.Html;
       mm.Body=MailBody;
       mm.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");      mm.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "[email protected]");    mm.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "pop.yahoo.com");
       
       SmtpMail.SmtpServer="smtp.yahoo.com";
       SmtpMail.Send(mm);  }
      

  2.   

    另外,SQL SERVER 有sp_sendmail储存过程发送邮件的。
      

  3.   

    http://www.cnblogs.com/tormado/archive/2005/03/10/116264.html