C# Outlook Generating Email with an Attachment

Soldato
Joined
25 Oct 2002
Posts
2,642
I have come across the following issue with adding attachments to an Outlook email via a C# application.

In short my application is generating 2-300 unique individual emails; each of the emails has the same attachment.

When the attachment is added to the email Outlook is creating a copy of the file in 'OutlookSecureTempFolder' - the location of this held within
Code:
[HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Outlook\Security]

The copy of the attachment is being created for each individual email - as the attachments all have the same names they are subsequently being named attachment(1).txt... attachment(2).txt and so on. It will copy them until it gets to (200) at which point it will not create any more copies and gives an error stating it cannot create file. I'm not sure why it isn't deleting these copies as it goes as after creating the email it is immediately sent.

Has anyone come across this - is there a way to force Outlook to clear its temporary folder? Any help would be appreciated.
 
Back
Top Bottom