public void sendEmail(string email)
{
string smtp = "smtp.163.com";
string mailForm = "asp_yangdong@163.com";
string mailPwd = "tear2112";
string mailTo = email;
string mailTitle = "邮件标题";
string mailContent = "www.sina.com.cn";
SmtpClient client = new SmtpClient(smtp);
client.UseDefaultCredentials = false;
client.Credentials = new NetworkCredential(mailForm, mailPwd);
client.DeliveryMethod = SmtpDeliveryMethod.Network;
MailMessage message = new MailMessage(mailForm, mailTo, mailTitle, mailContent);
message.BodyEncoding = Encoding.Default;
message.IsBodyHtml = true;
client.Send(message);
}
发送成功,但是接收的时候,是以文本显示的。请问应该怎么修改?
可以直接写HTML吧。
尊敬的XX:
请点击下面链接激活:
<a href="http://space.cnblogs.com/q/19701/" >http://space.cnblogs.com</a>
如无法点击 请将链接复制到地址栏。