日期:2014-05-17  浏览次数:20515 次

.net 邮件 有错,帮忙!!!!!!!!!!!!!!!!!
C# code


protected void Page_Load(object sender, EventArgs e)
    {



        try
        {
            SmtpClient client = new SmtpClient();
            client.DeliveryMethod = SmtpDeliveryMethod.Network;
            client.EnableSsl = false;
            client.Host = "smtp.126.com";
            client.Port = 25;
            client.Credentials = new NetworkCredential("*******@126.com", "******");




            MailMessage message = new MailMessage();
            message.Priority = MailPriority.Normal;
            message.From = new MailAddress("********@126.com", null, Encoding.GetEncoding(936));
            message.ReplyTo = new MailAddress("********@126.com", null, Encoding.GetEncoding(936));
            message.To.Add("********@qq.com");

            message.Subject = "zhuti";
            message.SubjectEncoding = Encoding.GetEncoding(936);
            message.IsBodyHtml = true;
            message.BodyEncoding = Encoding.GetEncoding(936);
            message.Body = "<img src='http://www.baidu.com/img/baidu_logo.gif'>";


            client.Send(message);
        }
        catch (Exception ex)
        {

            Response.Write(ex.Message);
        }




    }

    





运行之后错误:


事务失败。 服务器响应为: DT:SPM smtp4, jdKowLD7g5j5ECBMj85eAA--.6019S2 1277169914 http://mail.163.com/help/help_spam_16.htm?ip=125.41.201.126&hostid=smtp4&time=1277169914

------解决方案--------------------
据我所知126的不提供smtp服务,不能用它来发邮件
qq的可以
------解决方案--------------------
我的百度:http://hi.baidu.com/gdlpc88/blog/item/d2dfb62cc2310e5a4fc22641.html