SMTP email having Html body and file attachment problem

I cannot figure out how to generate an email that is text/html and send an attachment with it.

I tried creating a Mime Data object, converted the html text string to bytes and then a stream, invoked the addBodyPart, invoke getEnvelopeStream, and then finally invoke smtp mapping my envStream to mimeStream and my attachment record to smtp’s attachments record…

and I get the email ok, but I do not get the attachment.

I have searched the forums prior to asking my question and I did not see a resolution. Please tell me what I am missing?

Using wm dev 6.5

Did you ever notice that when you finally give up and post a message, thats about the time you finally find a solution…

I ripped out that code and made it simpler. If you have a similar conundrum, here’s what I did…

I created a new Document Type called ‘attachments’ with all the variables of the Document List ‘attachments’ used in the smtp service. Using the appendToDocumentList service, I appedned my excel filename to my ‘attachments’ List. I then convert the text/html message to a stream. Create another ‘attachments’ record to store that content and contenttype for the text, then use appendToDocumentList again to add the text to my outbound email document. Then I hook that DocumentList up to the smtp services ‘attachments’ and it sends both the spreadsheet and the body text in html.

Hi zoom,

Our service will generate an HTML file…

I need send that HTML file as an attachement to email address.

Can you explain the steps that need to be followed.

we are using 4.6 verson.