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
posted 9 years ago
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...
truely amazing !
Fire me boy! Cool, soothing, shameless self promotion:
ScroogeXHTML - small and flexible RTF to HTML converter library