简体   繁体   English

Outlook加载项邮件发送

[英]Outlook AddIn mailsend

I want to deploy an addin to outlook 2013. 我想将外接程序部署到Outlook 2013。

The basic principle is that if an employee send an email to a certain adress, then the addin will auto fill his body with some info he must provide. 基本原则是,如果员工向特定地址发送电子邮件,则插件将自动用他必须提供的某些信息填充其身体。

i tried this but it won't work. 我试过了,但是行不通。

 if (mailItem.To == "some@example.com")
                { 
                mailItem.Subject = "support ticket";
                mailItem.Body = "IP :[                       ]";
                }

When exactly does the code run? 该代码何时准确运行? in the Application.ItemSend event? Application.ItemSend事件中? What exactly does not work? 到底什么不起作用? You need to be a lot more specific than that. 您需要比这更具体。

If it is (as I suspect) the test for the email address that is failing, you need to avoid using the To property and instead loop through the Recipients collection comparing each Recipient.Address property. 如果是(如我所怀疑的)电子邮件地址测试失败,则需要避免使用To属性,而应循环比较每个Recipient.Address属性的Recipients集合。 If it is an Exchange mailbox, the address will be an EX type address (as opposed to SMTP) and you will need to use 如果是Exchange邮箱,则该地址将是EX类型的地址(与SMTP相对),您将需要使用

`Recipient.AddressEntry.GetExchangeUser().PrimarySmtpAddress`

(be prepared to handle nulls and exceptions). (准备处理null和异常)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM