asp.net把提交的数据发送到邮箱。请问该如何实现?急

解决方案 »

  1.   

    那就在Asp.net上实现邮件的发送啊。在Asp.net中这是很好实现的啊。
      

  2.   

    利用System.Web.Mail命名空间里的MailMessage;MailMessage myMail= new MailMessage();   
    myMail.From = "...";   
    myMail.To = "...";   
    myMail.Subject = "回复:"+titleTextBox.ToString();   
    myMail.Body=reTextBox.ToString();   可以直接发邮件,不过邮件服务器必须是不用验证的;
      

  3.   

    public void CDOsendMail(string f_email,string t_email,string zh,string mm)
    {
    try
    {    
    CDO.Message oMsg = new CDO.Message();
        
    oMsg.From = f_email;
    oMsg.To = t_email;
    oMsg.Subject = "东风威客取回密码";
                     
    oMsg.HTMLBody = "<html><body>这是您的帐号信息:<br>帐号:"+zh+"<br>密码:"+mm+"<br><a href='http://www.33419.cn'>东风工作室</a></body></html>"; CDO.IConfiguration iConfg = oMsg.Configuration;
    ADODB.Fields oFields = iConfg.Fields;
              
    oFields["http://schemas.microsoft.com/cdo/configuration/sendusing"].Value=2;
    oFields["http://schemas.microsoft.com/cdo/configuration/sendemailaddress"].Value=f_email; //sender mail
    oFields["http://schemas.microsoft.com/cdo/configuration/smtpaccountname"].Value=f_email; //email account
    oFields["http://schemas.microsoft.com/cdo/configuration/sendusername"].Value="roamabout";
    oFields["http://schemas.microsoft.com/cdo/configuration/sendpassword"].Value="kk123"; 
    oFields["http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"].Value=1;
    //value=0 代表Anonymous验证方式(不需要验证)
    //value=1 代表Basic验证方式(使用basic (clear-text) authentication. 
    //The configuration sendusername/sendpassword or postusername/postpassword fields are used to specify credentials.)
    //Value=2 代表NTLM验证方式(Secure Password Authentication in Microsoft Outlook Express)
    oFields["http://schemas.microsoft.com/cdo/configuration/languagecode"].Value=0x0804;
    oFields["http://schemas.microsoft.com/cdo/configuration/smtpserver"].Value="smtp.126.com"; oFields.Update();
    oMsg.BodyPart.Charset="gb2312";
    oMsg.HTMLBodyPart.Charset="gb2312";  oMsg.Send();
    oMsg = null;
    }   
    catch (Exception e)
    {
    throw e;
    }
    }再添加一个引用,如果你是xp系统请到c:\windiws下找到cdosys.dll,如果是2000到c:\winnet找cdosys.dll(不要说不会添加引用吧???)
      

  4.   

    邮件无法发送到 SMTP 服务器。传输错误代码为 0x80040217。服务器响应为 not available