Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 以html格式发送电子邮件_Asp.net_Vb.net_Email Formats - Fatal编程技术网

Asp.net 以html格式发送电子邮件

Asp.net 以html格式发送电子邮件,asp.net,vb.net,email-formats,Asp.net,Vb.net,Email Formats,…问题是消息以纯文本形式发送,包括正文中的标记 如何以html格式发送电子邮件?我不知道如何在VB中执行此操作,但您需要将mime类型设置为text/html轻松: Dim objMail As New Mail.MailMessage("no-reply@mywebsite.com", ToEmail, "Password Reset", body) 查看一下您需要指定邮件正文以HTML格式发送。。。像这样: objMail.IsBodyHtml = True 仅供参考,BodyForma

…问题是消息以纯文本形式发送,包括正文中的

标记


如何以html格式发送电子邮件?

我不知道如何在VB中执行此操作,但您需要将mime类型设置为text/html

轻松:

Dim objMail As New Mail.MailMessage("no-reply@mywebsite.com", ToEmail, "Password Reset", body)

查看一下

您需要指定邮件正文以HTML格式发送。。。像这样:

objMail.IsBodyHtml = True

仅供参考,BodyFormat属性用于MailItem对象,而不是MailMessage。
objMail.BodyFormat = System.Web.Mail.MailFormat.Html;