|
ms
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
problem with adding attachment to a mailI'm try to write a very simple winform app that allows the users to send an email. I use the System.Web.Mail MailMessage class for this. But when it comes to adding an attachment, something appears to go wrong. After I execute the following code, the MailMessage appears to have an attachment (looked it up through a watch in debug mode), but when I actually send the message, the attachment is not send along with it. So the message arrives in my inbox, but without the attachment. What am I doing wrong, Many thanks, Bart public void AddAttachment (string file) { MailAttachment bijlage = new MailAttachment(file,MailEncoding.Base64); if (!message.Attachments.Contains(bijlage)) { message.Attachments.Add(bijlage); } }
Other interesting topics
encrypt/decrypt
How to - Access another application's Text Serialize a Form. Did microsoft invent their own unit of time? Problems with GDI+ and transparent PNG-Imges problem with Mail attachments Classes Disable programmatically raised events How to write a CommandText to include db values Windows Service Problem |
|||||||||||||||||||||||