Hey Guys,
I'm trying to write a very simple thing that allows a user to send an e-mail
from a windows form app.
I use the System.Web.Mail MailMessage class for this and then send my e-mail
through a smtp server.
The problem i have is with adding attachments. I use the following code
public void AddAttachment (string file)
{
MailAttachment bijlage = new MailAttachment(file,MailEncoding.Base64);
if (!message.Attachments.Contains(bijlage))
{
message.Attachments.Add(bijlage);
}
}
Now when I use the debugger, my message (MailMessage) tells me it has an
attachment, but when I send the message the attachment is not sent with it.
So it shows up in my inbox, but without the attachment.
What am I doing wrong here??
Many thanks,
Bart