源码是这样的
MailMessage mail = new MailMessage("******@maxwealth.cn",//发件人地址
            "[email protected]",//收件人地址
            "闷",//主题
            "<a href=\"www.baidu.com\">146</a>");//内容
         mail.IsBodyHtml = true;
        SmtpClient sc = new SmtpClient("202.104.57.142");
        sc.Credentials = new System.Net.NetworkCredential("*****", "*********");
        sc.Send(mail);
能发送,但是查看邮件是不能超链接不正确,超链接显示的是href="#".怎么会这样?!!谁来帮帮我?

解决方案 »

  1.   

    你要进行HTML编码后发送吧..httputility.htmlencode(" <a href=\"www.baidu.com\">146 </a>")试试
      

  2.   

    MailMessage mail = new MailMessage("******@maxwealth.cn",//发件人地址
                "[email protected]");
            mail.Subject = "闷";
            string str=HttpUtility.HtmlEncode("<a href=\"www.baidu.com\">146</a>");
            mail.IsBodyHtml = true;
            mail.Body = str;
            SmtpClient sc = new SmtpClient("202.104.57.142");
            sc.Credentials = new System.Net.NetworkCredential("****", "******");        sc.Send(mail);
    是这样用么? 但用后他显示的是<a href="www.baidu.com">146</a> 纯文本格式.
    等待回复中!
      

  3.   

    问题解决了。 前面加个http:// 就可以了 。 闷 弄了哪么久! 谢谢大家!