I am using Vs2010 -> Extensibility->Shared Add-in I have added a event handler to my ItemSend
applicationObject.ItemSend += new Outlook.ApplicationEvents_11_ItemSendEventHandler(applicationObject_ItemSend);
void applicationObject_ItemSend(object Item, ref bool Cancel)
{
if(Item is Outlook.MailItem)
{
Outlook.MailItem mailItem = Item as Outlook.MailItem;
if (mailItem != null)
{
MessageBox.Show("Sender's Email Address "+mailItem.SenderEmailAddress);
MessageBox.Show("Sender's Email Address "+mailItem.SentOnBehalfOfName);
MessageBox.Show("Sender's Email Address "+mailItem.SendUsingAccount);
}
}
}
mailItem.SenderEmailAddress,mailItem.SentOnBehalfOfName
and mailItem.SendUsingAccount
I am geting all of this property null
Please can you anyone help me out
I want to get From, SentOnBehalfOfName
and Account name from with the email was sent.
Sender related properties are set only after the message is actually sent and moved to the Sent Items folder. You might want to use the Items.ItemAdd event on the Sent Items folder.