Wie füge ich blockierte Dateitypen als Anhänge zu einer Outlook-E-Mail-Nachricht hinzu?C#

Ein Treffpunkt für C#-Programmierer
Anonymous
 Wie füge ich blockierte Dateitypen als Anhänge zu einer Outlook-E-Mail-Nachricht hinzu?

Post by Anonymous »

Ich versuche, Anhänge aus einer E-Mail zu extrahieren und diese Dateien an eine andere E-Mail-Nachricht anzuhängen.
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();
}
Warum werden diese bestimmten Anhangstypen nicht angezeigt?

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post