This is how I do it.
pdfFileName =
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments),
"bikelist.pdf");
NSData data =
NSData.FromFile(pdfFileName);
Core.Instance.mail =
new MFMailComposeViewController();
Core.Instance.mail.SetSubject("Bike list");
Core.Instance.mail.SetMessageBody("", true);
Core.Instance.mail.Finished += HandleMailFinished;
Core.Instance.mail.AddAttachmentData(data, "text/x-pdf", "bikelist.pdf");
NavigationController.PresentViewController(Core.Instance.mail, true, null);
On 11 Dec 2012, at 17:44, Matronix <[email protected]> wrote:
> I am trying to send a PDF from my app in an email. The email sends
> successful and when I look at the PDF attachment in my email (Gmail,
> desktop) the attachment looks like a broken image and doesn't have a way to
> download the file. If I view the email on the iPad's mail app, the pdf
> shows up as an image in the email. How do I successfully attach a PDF to an
> email so that it can be downloaded/viewed on any email client like a normal
> emailed attachment?
>
>
> NSData pdf = NSData.FromFile(path);
> mailController.AddAttachmentData(pdf, "application/pdf", "Result.pdf");
>
>
>
>
> --
> View this message in context:
> http://monotouch.2284126.n4.nabble.com/MFMailComposeViewController-AddAttachmentData-PDF-not-working-tp4657826.html
> Sent from the MonoTouch mailing list archive at Nabble.com.
> _______________________________________________
> MonoTouch mailing list
> [email protected]
> http://lists.ximian.com/mailman/listinfo/monotouch
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch