I want to send email with a PDF attachment. I created PDF file, then I did the following which is wrong I believe:
// locate folder containing pdf file
You are passing wrong mimeType to addAttachmentData(). Use application/pdf instead of pdf.
mimeType
addAttachmentData()
application/pdf
pdf