Generally I don't think this is Mail.dll issue.
When you use MailBuilder class to create an email message:
MailBuilder builder = new MailBuilder();
builder.From.Add(new MailBox("alice@mail.com", "Alice"));
builder.To.Add(new MailBox("bob@mail.com", "Bob"));
builder.Subject = "Test";
builder.Text = "This is plain text message.";
// Read attachment from disk, add it to Attachments collection
MimeData attachment = builder.AddAttachment(@"../image.jpg");
IMail email = builder.Create();
using (Smtp smtp = new Smtp())
{
smtp.Connect("server.example.com"); // or ConnectSSL for SSL
smtp.UseBestLogin("user", "password"); // remove if not needed
smtp.SendMessage(email);
smtp.Close();
}
You use:
MimeData attachment = builder.AddAttachment(@"../image.jpg");
You can check if attachment.Data contains any data after the call to this method.
Internally MailBuilder.AddAttachment uses MimeData.LoadFromFile method, which in turn uses following code:
using (FileStream stream = File.OpenRead(path))
{
return new BinaryReader(stream).ReadBytes(stream.Length);
}
I don't think there can be a bug in this code.
Please double check the file name (with extension), maybe this is just a simple mistake.