Although the email content is absolutely fine, the attachement is not gettig attached. The email comes without an attachment. Can someone please let me know how to attach a file to this email
In your first example, you add all attachments, but then you overwrite them with the body.
You must use a MimeMultiPart, and create one body part for the HTML and one for each attachment. The file body part will work just as the one you have now; the HTML body part will be similar to how you set the HTML contents for your message.
A similar problem, I have my body part working, if I comment the code to the the filename, attachment. I have created MultiMimePart for body and for attachment but still get the error. Any suggestions for this please