2016-07-01 49 views
0
var theApp = new ActiveXObject("Outlook.Application");  
var theMailItem = theApp.CreateItem(0); 
theMailItem.To = to; 
theMailItem.Subject = (subject); 
theMailItem.CC = carbon; 
theMailItem.Body = (msg);  
theMailItem.display(); 

我使用上面的JavaScript代碼通過outlook發送電子郵件一切正常,但郵件的正文不是HTML格式,任何人都可以請幫助我。在此先感謝郵件正文html格式爲javascript

+0

可能有用:http://stackoverflow.com/questions/20509994/open-new-email-in-outlook-with-html-body-from-ie-web-site – DBS

回答

0

而不是設置純文本Body屬性,將HTMLBody屬性設置爲正確格式的HTML字符串。