简体   繁体   English

将Outlook 2003默认签名添加到电子邮件

[英]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.

相关问题 如何使用 JavaScript 将签名添加到 Outlook email 中? - How can I add a signature into an Outlook email with JavaScript mailto? JS / PHP:在Outlook中通过电子邮件撰写和添加附件 - JS/PHP : Email Compose and add attachment in Outlook Outlook 插件 - 在选择 email 时设置 UI - Outlook Add-In - Setting UI on selection of email Javascript:打开 Outlook 并将附件添加到新电子邮件 - Javascript: Open Outlook and add attachments to new email Outlook添加开发-获取电子邮件正文 - Outlook add in development - Get email body 使用javascript从HTML发送电子邮件而没有默认Outlook - sending email from html using javascript without default outlook NodeJS Mail listener2 正在将电子邮件签名图像作为附件下载到 Outlook 中,如何阻止它? - NodeJS Mail listener2 is downloading email signature images as attachments in outlook, how to stop it? 使用mailto URL将附件添加到新的Outlook电子邮件中 - Add an attachement to a new outlook email using mailto URL 是否可以在 Outlook 插件中向电子邮件的 HTML 正文添加交互性? - Is it possible to add interactivity to the HTML body of the email in an Outlook Addin? 当新电子邮件进入邮箱时自动初始化Outlook添加 - Auto initialize outlook add in when new email comes in Mailbox
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM