private static System.Net.Mail.Attachment ConvertAttachment(Attachment attachment) { if (attachment.UsesStream) { return new System.Net.Mail.Attachment(attachment.ContentStream, attachment.FileName); } return new System.Net.Mail.Attachment(attachment.FileName); }