I have some code written in VBA designed to run in excel which is supposed to send a html email. This worked fine originally but I have tried to late bound me code, an email is still sent however the HTML appears as plain text to the recipient. The code I have is:
Dim oAPP As Object
Dim oItem As Object
Const olMailItem As Long = 0
Set oAPP = CreateObject("Outlook.Application")
Set oItem = oAPP.CreateItem(olMailItem)
With oItem
.To = Worksheets("Emails").Cells(1, 2).Value
.Subject = "Product set-up request"
.BodyFormat = 2
.Body = emailbody
.send
End With
将.Body = emailbody
更改为.HTMLBody = emailbody
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.