I am trying to extract attachments from a mail and attach those files to another mail Item.
Everything works fine but if I try to add an attachment wich has a blocked extension, the attachment won't get added to the mail item. Following is what I have done:
private void addAttachments( Redemption.RDOMail sourceMail , ref Redemption.RDOMail targetMail )
{
foreach (Redemption.RDOAttachment attachment in sourceMail.Attachments)
{
// Saving attachment files from source mail on local disk
attachment.SaveAsFile(/*File Path*/);
// adding attachment to target mail from saved location
//At this point, target mail has the attachment count incremented
targetMail.Attachments.Add(/*File PAth*/ + attachment.DisplayName);
// deleting file, saved on local disk
File.Delete(/*File Path + attachment.DisplayName*/);
}
targetMail.Save();
// when the mail item is being displayed, the added attachment with the *.EXE,
//or all the other attachment extentions which are blocked from viewing by outlook is gone.
// This does not happen for other attachment files
targetMail.Display();
}
Why these particular attachment types won't get displayed?