private void AddAttachmentFromStream(MailMessage message, String data, String attachmentName)
{
MemoryStream stream = new MemoryStream(UTF32Encoding.Default.GetBytes(data));
stream.Position = 0;
// Create a new attachment, add the attachment to the supplied message.
Attachment att = new Attachment(stream, attachmentName);
message.Attachments.Add(att);
}
No comments:
Post a Comment