Alles funktioniert einwandfrei, aber wenn ich versuche, einen Anhang hinzuzufügen, der eine blockierte Erweiterung hat, wird der Anhang nicht zur E-Mail-Nachricht hinzugefügt. Folgendes habe ich getan:
Code: Select all
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 extensions which are blocked from viewing by outlook is gone.
// This does not happen for other attachment files
targetMail.Display();
}
Mobile version