Hi
I have a function that sends email messages plus attachments.
I'm worried about the memorystream I'm using in the following clipped code
sample.
Will it be closed/disposed of without me doing anything ?
If not, should I be storing reference to the streams I create and
close/dispose of them after the message is sent?
thank you :)
// Attachments
if (Attachments != null)
{
foreach (tableMessagesEmailAttachments attachment in Attachments)
{
MemoryStream ms = new MemoryStream(attachment.AttachmentData);
System.Net.Mail.Attachment att = new Attachment(ms,
attachment.AttachmentFilename);
Message.Attachments.Add(att);
}
}
MailClient.Send(Message);