saving a contact (present as an attachment in the mail) into outlo

B

Bharathi

Hi,

I have a requirement where i need to extract the contact which is present as
an attachment in the mail and save it into my Outlook.

Currently I am saving the attachment into TEMP folder. I do not know how to
put the that attachment in to my outlook

I am using C#.net for programming..

Here is the code :
void Application_NewMailEx(string EntryIDCollection)
{
object obj =
Application.Session.GetItemFromID(EntryIDCollection, Type.Missing);

if (obj is MailItem)
{
MailItem mi = obj as MailItem;

if (mi.Attachments.Count > 0)
{
foreach (Attachment a in mi.Attachments)
{
if (a.FileName.Contains(".msg"))
{

a.SaveAsFile(Environment.GetEnvironmentVariable("TEMP") + "\\" + a.FileName);
}
}
}
}
}

Please someone help me how to proceed furthur.

Thank you,
Bharathi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top