I'm trying to send a PDF file for a Kindle device.
If I send that file using my GMAIL account (sending via web browser) the file is sent properly (I can see that file under the Amazon > Manage Your Kindle section)
My SmtpClient configuration code is fine - any emails under my project are being sent properly.
Only sending a file as an email attachment is not working, I don't see that file in the Amazon > Manage Your Kindle section. The code below doesn't throw any exceptions or errors, the message is sent.
var smtp = new SmtpClient()
{
Host = "SMTP_SERVER",
Port = "SMTP_PORT",
EnableSsl = true,
DeliveryMethod = SmtpDeliveryMethod.Network,
UseDefaultCredentials = false,
Credentials = new NetworkCredential("login", "pass")
};
var msg = new MailMessage(new MailAddress("my_email", "my_name"),
new MailAddress("some_name@kindle.com"))
{
Subject = "Your Kindle file",
IsBodyHtml = true
};
Attachment data = new Attachment(PDF_file_path,
MediaTypeNames.Application.Pdf);
msg.Attachments.Add(data);
smtp.Send(msg);
Any ideas ?