See this:
http://www.microsoft.com/China/Community/program/originalarticles/TechDoc/sendmail.mspx

解决方案 »

  1.   

    SmtpMail.SmtpServer = "Smtp服务器的IP地址";
      

  2.   

    现在很多服务器使用密码验证推荐jmail
      

  3.   

    MailMessage Message=new MailMessage(); 
    Message.From=sender_ddl.SelectedItem.Value+"@tpco.com.cn";
    Message.To=TextBox1.Text;
    Message.Subject=TextBox3.Text;
    Message.Body=TextBox2.Text;
    Message.BodyFormat=MailFormat.Text;
    Message.Priority=MailPriority.Low;
        
             string[]  ServerPool = new string[2];
    ServerPool[0]="dns.tpco.com.cn";
    //ServerPool[1]="smtp.163.com";
    SmtpMail.SmtpServer=ServerPool[0];
    try
    {
       SmtpMail.Send(Message); catch
             {
     Response.Write("<script language='javascript'>alert('邮件发送失败!')</script>");
    }
      

  4.   

    zhangzs8896(小二) 不行啊,出现一大串的错误!!
    发送邮件失败:System.Web.HttpException: Could not access 'CDO.Message' object. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x80040213): The transport failed to connect to the server. --- End of inner exception stack trace --- at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters) at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) --- End of inner exception stack trace --- at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) at System.Web.Mail.CdoSysHelper.Send(MailMessage message) at System.Web.Mail.CdoSysHelper.Send(String from, String to, String subject, String messageText) at System.Web.Mail.SmtpMail.Send(String from, String to, String subject, String messageText) at ASP.mail_aspx.send_Mail(Object sender, EventArgs e) in D:\yuyongfa\chaoyang\mail.aspx:line 23
      

  5.   

    你用的是自己的机子上网,还是用了代理,如果用了代理
    SmtpMail.SmtpServer = "代理服务器的IP地址";
    如果没有用就用SmtpMail.SmtpServer = "本地机服务器的IP地址";