Quantcast
Channel: Exchange Server Development forum
Viewing all articles
Browse latest Browse all 7132

Attachment.AttachmentType is really read only? howto set the Disposition then

$
0
0
Hi all,

i still working on a transportAgent which is able to insert a graphic as attachment to all outgoing Tnef mails.

I include this attachment with following code:

1 Attachment logo = emailMessage.Attachments.Add(showAsFilename);  
2 logo.AttachmentType = AttachmentType.Inline;  
3 logo.ContentType = "image/gif";  
4 Stream logologo_stream = logo.GetContentWriteStream();  
5 logo_stream.Write(logo_binary, 0, logo_binary.Length);  
6 logo_stream.Flush();  
7 logo_stream.Close(); 

But in this case, line 2 gives me an error:

Error 1 Property or indexer 'Microsoft.Exchange.Data.Transport.Email.Attachment.AttachmentType' cannot be assigned to -- it is read only

My Question is: How is it possible to change this attribute or is there another way to put headers like Content-Disposition?

Viewing all articles
Browse latest Browse all 7132

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>