0

我在 vbscript 中编写了一些代码来使用 Outlook 自动向收件人发送邮件,一切正常,但我只有一个问题,我为邮件正文选择的格式在收件人的邮箱中发生了变化。我使用了font color- blue and font face -calibri but it got changed into Times new roman without any color.

有什么解决办法吗?

Set MyApp = CreateObject("Outlook.Application")
    Set MyItem = MyApp.CreateItem(0) 'olMailItem
    With MyItem
            .To = "abc@com"
            .Subject = ""
            .ReadReceiptRequested = False

            .HTMLBody = "<font size='3' face='Calibri' color='#151B54'>Hi,Whatever written here got changed into plain text.<font>"




            .Attachments.Add "C:\Excels\"& objFso.GetFileName(objFile.path)
    End With
    MyItem.Display
    End if

或者我必须在已发送邮件的 Outlook 中更改任何设置?

4

1 回答 1

0

这对我来说非常好:

MailItem sendMail = Globals.ThisAddIn.Application.CreateItem(OlItemType.olMailItem);
        sendMail.Subject = "test";
        sendMail.To = SenderName; //or email
        sendMail.HTMLBody = "<font size='50' face='Verdana' color='#ff0000'>Hi,Whatever written here got changed into plain text.<font>";
        sendMail.Send();

当我将此发送给自己时,我会收到一条红色的大红色文字

请注意,这是 c#,所以我不确定它是否会对您有所帮助

编辑:

还有一件事: font size='3' 也不适用于我。因为它太小而不能体面地展示

于 2013-02-27T14:52:35.600 回答