2013-02-27 112 views
0

我已经在vbscript中编写了一些代码来使用outlook自动发送邮件给收件人,一切正常,但我只有一个问题,我为邮件选择了什么格式身体在收信人的邮箱里变了。我用font color- blue and font face -calibri but it got changed into Times new roman without any color收件人的邮箱中的邮件格式在Outlook中被更改

任何解决方案?

Set MyApp = CreateObject("Outlook.Application") 
    Set MyItem = MyApp.CreateItem(0) 'olMailItem 
    With MyItem 
      .To = "[email protected]" 
      .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 

或者是否有任何设置,我必须改变发送邮件的前景?

回答

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#,所以我不知道是否会帮助你

编辑:

一件事:字体大小=“3”不跟我工作的。因为它太小而不能正常显示

相关问题