[英]add outlook 2003 default signature to email
have used the following JavaScript code, to create outlook 2003 emails from a web page. 已使用以下JavaScript代码从网页创建Outlook 2003电子邮件。 The default signature is not showing up, but everything else works. 默认签名未显示,但其他所有功能均正常。 How can I add the default signature? 如何添加默认签名?
Thanks in advance! 提前致谢!
var outlookApp = new ActiveXObject("Outlook.Application");
var nameSpace = outlookApp.getNameSpace("MAPI");
mailFolder = nameSpace.getDefaultFolder(6);
mailItem = mailFolder.Items.add('IPM.Note.FormA');
mailItem.To = document.getElementById("pEmail").value;
mailItem.CC ="test@tt.com";
mailItem.HTMLBody = "Hello,";
mailItem.HTMLBody += "<p><hr></p>";
mailItem.display (0);
Firstly, you wipe out the existing body when you set the HTMLBody property - you must merge the existing data. 首先,在设置HTMLBody属性时擦除现有主体-必须合并现有数据。 Also avoid using "+=" when working with HTMLBody. 使用HTMLBody时,也请避免使用“ + =”。
Secondly, the signature is added when you call MailItem.Display or access MailItem.GetINspector. 其次,当您调用MailItem.Display或访问MailItem.GetINspector时,将添加签名。 You must do that before you manipulate the body. 在操作身体之前,必须先这样做。
I found out the answer I was looking for, with the guidance of Dmitry Streblechenko. 在Dmitry Streblechenko的指导下,我找到了所需的答案。 Thank you again Dmitry Streblechenko. 再次感谢德米特里·斯特雷布连科。 to add the signature to my script just add the following 要将签名添加到我的脚本中,只需添加以下内容
// add this before creating the actual email.
var insp = mailItem.GetInspector;
var mySigline = mailItem.HTMLBody;
// build the actual email.
// Last line of email
mailItem.HTMLBody += mySigline;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.