0
votes

I want to deploy an addin to 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 == "[email protected]")
                { 
                mailItem.Subject = "support ticket";
                mailItem.Body = "IP :[                       ]";
                }
1

1 Answers

0
votes

When exactly does the code run? in the Application.ItemSend event? 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. If it is an Exchange mailbox, the address will be an EX type address (as opposed to SMTP) and you will need to use

`Recipient.AddressEntry.GetExchangeUser().PrimarySmtpAddress`

(be prepared to handle nulls and exceptions).