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
Joined: Sep 12, 2009
got the answer to my question, was setting the filename incorrectly, Its amazing how much you could learn by looking at the code of others...