SmtpMail.SmtpServer=.........;
是不可以去掉的,它指明了邮件服务器
myMail.From = "[email protected]";
这个写错了吧

解决方案 »

  1.   

    如果要设置邮件服务器,既然用了 263.sina.com 的邮箱,也应该是 smtp.263.sina.com(可能不是这样的地址,提示而已)。From 与 SmtpServer 必须匹配。如果不设置邮件服务器,那么必须在 WIN2000、XP、2003 上安装 IIS,并且安装 Smtp 服务。
      

  2.   

    using System;
    using System.Collections;
    using System.ComponentModel;
    using System.Configuration;
    using System.Data;
    using System.Drawing;
    using System.Web;
    using System.Web.SessionState;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.HtmlControls;
    using System.Web.Mail;//邮件使用
    using System.Windows.Forms; //Messagebox使用;namespace zzs_test
    {
    /// <summary>
    /// Mail 的摘要说明。
    /// </summary>
    public class Mail : System.Web.UI.Page
    {
    protected System.Web.UI.WebControls.TextBox TextBox1;
    protected System.Web.UI.WebControls.TextBox TextBox2;
    protected System.Web.UI.WebControls.Label Label1;
    protected System.Web.UI.WebControls.Label Label2;
    protected System.Web.UI.WebControls.TextBox TextBox3;
    protected System.Web.UI.WebControls.Label Label3;
    protected System.Web.UI.WebControls.DropDownList sender_ddl;
    protected System.Web.UI.WebControls.Label Label4;
    protected System.Web.UI.WebControls.Button btn_send;

    private void Page_Load(object sender, System.EventArgs e)
    {
    // 在此处放置用户代码以初始化页面
    //  Response.Write("test:    " +ConfigurationSettings.AppSettings["test"]);
    //            Response.End();
    } #region Web Form Designer generated code
    override protected void OnInit(EventArgs e)
    {
    //
    // CODEGEN:该调用是 ASP.NET Web 窗体设计器所必需的。
    //
    InitializeComponent();
    base.OnInit(e);
    }

    /// <summary>
    /// 设计器支持所需的方法 - 不要使用代码编辑器修改
    /// 此方法的内容。
    /// </summary>
    private void InitializeComponent()
    {    
    this.btn_send.Click += new System.EventHandler(this.btn_send_Click);
    this.Load += new System.EventHandler(this.Page_Load); }
    #endregion private void btn_send_Click(object sender, System.EventArgs e)//发送
    {
    MailMessage Message=new MailMessage(); 
    //Message.From="[email protected]";
    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];
    SmtpMail.Send(Message); MessageBox.Show("成功发送到 "+ TextBox1.Text, "C#邮件",MessageBoxButtons.OK,
    MessageBoxIcon.Information,MessageBoxDefaultButton.Button1,MessageBoxOptions.ServiceNotification);        
    }
    }
    }
      

  3.   

    TO: zhangzs8896(小二)SmtpMail.Send 的内部调用是个异步过程,你凭什么调用后就能认为“成功发送”了呢?不过这个问题,我正在思考中,还不知如何解决。可能是 .NET FCL 的一个 BUG 吧。