Thursday, November 29, 2012 9:30 PM
I'm trying to convert all outgoing emails that match a certain criteria to HTML formatted email using a Transport Agent on Exchange server. I have the TA correctly wired up; I can't figure out how to change the message content-type. The closest I've got is this, which just results in a blank email body:
If body.BodyFormat <> BodyFormat.Html Then Dim oTextToHTML As New Microsoft.Exchange.Data.TextConverters.TextToHtml() Dim html As New ConverterReader(body.GetContentWriteStream(), oTextToHTML) newBodyContent = body.GetContentWriteStream() oTextToHTML.Convert(html, newBodyContent) End If
If I comment of these lines or send already HTML formatted email then the message arrives correctly which implies to me that this is source of the problem (and solution).
Friday, January 11, 2013 12:32 PMAfter converting the text body, in the given code you are not assigning it to body again. I think after getting html format in "newBodyContent", you have to assign to body again...
Wednesday, February 13, 2013 9:43 PMDid you ever figure this out? I am trying to do the same exact thing but am having no luck at all.