2013-02-27 110 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」不跟我工作的。因爲它太小而不能正常顯示

相關問題