gpt4 book ai didi

email - 发送 HTML 电子邮件 asp

转载 作者:行者123 更新时间:2023-12-01 11:09:56 25 4
gpt4 key购买 nike

我想在电子邮件中添加一些 html。我尝试了以下方法。

vFromName = "someone"
vFromAddress = "someemail"
vTo = "recipient"
vSubject="someSubject"
vBodyofemail = "<html><table><tr><td><b>SomeText</b></td></tr></table></html>"

Call SendMail()

sub SendMail()
'change to address of your own SMTP server
strHost = "mail.internal.rouses.com"
Set Mail = Server.CreateObject("Persits.MailSender")
'enter valid SMTP host
Mail.Host = strHost
'From eMail address
Mail.FromName = vFromName
'From address
Mail.From = vFromAddress
'To eMail address
Mail.AddAddress vTo
'message subject
Mail.Subject = vSubject
'message body
Mail.Body = vBodyOfEmail
Mail.Send
end sub

我该怎么做?我试过 Mail.HtmlBody 但这也不起作用。电子邮件已发送,但我看到的只是 html 所在的标签。

最佳答案

根据 this page您需要将 IsHTML 标志设置为 true。

strHTML = "Hello world"

Mail.IsHTML = True
Mail.Body = "<HTML><BODY><CENTER>" & strHTML & "</CENTER></BODY></HTML>"

关于email - 发送 HTML 电子邮件 asp,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1079740/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com