By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,667 Members | 2,214 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,667 IT Pros & Developers. It's quick & easy.

problem with adding attachment to a mail

P: n/a
Hey guys,

I'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,


public void AddAttachment (string file)


MailAttachment bijlage = new MailAttachment(file,MailEncoding.Base64);

if (!message.Attachments.Contains(bijlage))




Nov 17 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
you don't need to send your issue more than once .

Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.