The email is sent with no html-tags, the tags are removed from the variable in some step, I don't know how to keep them. :-o (If I put a string with tags instead of the variable the html-tags are kept, for example
I saw solution somewhere while ago. I don't have orginal URL but code works. Just add xmlns:msxsl="urn:schemas-microsoft-com:xslt" and xmlns:csharp="urn:csharp-com:xslt" namespaces.
How to keep html-tags in a variable? (For use with Sendmail)
Hi!
I have a problem sending html-formatted email with Sendmail.
The $messageFormatted is a variable build like this:
The email is sent with no html-tags, the tags are removed from the variable in some step, I don't know how to keep them. :-o (If I put a string with tags instead of the variable the html-tags are kept, for example
)
So I wonder how to keep the html-tags in my variable. CData?
Thanks!
I noticed that this approach works:
But ... I have lots of variables in my message (which could not be used in CData) and using CData would mean a very messy code.
Well, ok, it's not sooo messy, and it work's so I'll use this for now :-)
I saw solution somewhere while ago. I don't have orginal URL but code works. Just add xmlns:msxsl="urn:schemas-microsoft-com:xslt" and xmlns:csharp="urn:csharp-com:xslt" namespaces.
Put function in XSLT
<msxsl:script language="C#" implements-prefix="csharp">
<![CDATA[
public static string getText(XPathNavigator nodes)
{
return nodes.OuterXml;
}
]]>
</msxsl:script>
Then call SendMail with the getText function
csharp:getText($messageFormatted)
Jukka-Pekka : ok, makes sense, thanks. Looks like a function that should be conventient to have in a helper xslt-extension-dll.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.