This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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...