我使用的代码如下所示,在发送邮件时,前两个或三个RangetoHTML功能保留格式,但在我发送Gmail时,其余部分的格式将丢失。无论如何我能解决这个问题吗?
With myMail
.Subject = (Worksheets("Hourly Orders").Range("J3").Text)
.From = "email@redacted"
.To = "email@redacted"
.CC = ""
.BCC = “”
.TextBody = "Please find below the " & (Worksheets("Hourly Orders").Range("J3").Text)
.HTMLBody = Strintro & _
"<br>" & "<b><u>%Cancelled</u></b>" & "<br><br>" & RangetoHTML(cancelp) & " <br>" & _
"<br>" & "<b><u>Cancellation Buckets</u></b>" & "<br>" & RangetoHTML(cancelb) & "<br>" & _
"<br>" & "<b><u>Top 10 Last Mile Hits</u></b>" & "<br>" & RangetoHTML(lm) & "<br>" & _
"<br>" & "<b><u>Area-Wise SLA</u></b>" & "<br>" & RangetoHTML(areasla) & "<br>" & _
"<br>" & "<b><u>Top 10 First Mile Hits</u></b>" & "<br>" & RangetoHTML(fm)