hello
into my project development i put send email in case of system exception with putin the message in bold so i have slect the propriety isbodyhtml as true but when the error message contains ui element the selector value is not appearing in the email screenshot below
any idea how can i put the selector with bold text in the email?
thanks
That’s because the <
character that’s part of the selector makes Outlook think it’s HTML code.
Put it inside <pre>
and </pre>
tags, in other words…
"<pre>" + exception.Message + "</pre>"
2 Likes
Please mark my reply as the solution if it solves your issue.
i put as you said but its not working…
Try this instead…
system.web.HttpUtility.HtmlEncode(exception.Message)
ppr
(Peter)
June 2, 2021, 7:54pm
6
Can you check
"<b>" + exception.Message + "</b>"
or
"<strong>" + exception.Message + "</strong>"
What is the result of
system.web.HttpUtility.HtmlEncode(exception.Message)
You can’t just say “it’s not working” - give us details. Error message? Text shows up but wrong? Text doesn’t show up?
(You can view the email source to see that the selector is there)
One simple way of dealing with it is just to replace the < and >
with [ and]
Replace(Replace(exception.Message,“<”,“[”),“>”,“]”)
1 Like
ppr
(Peter)
June 2, 2021, 8:21pm
10
entĂŁo seria:
"campo <b>Estimated resolution</b> e campos <b>Quantidade de...</b>"
was flagged as solution, so we do have second source
rchabbeh:
its not working…
with a detail description on what is not working / the result we could better help
isHtml is activated we do assume
Also combined with Pauls input to encode entities it should work.
so test bold
test encoding entities
test combined
rchabbeh
(rahma)
June 2, 2021, 8:40pm
11
this way is working its clear that the problem is in the caracters < and >
i try to find a way to keep them as text
Yes, as I already explained < and >
are characters that are used in HTML code. So Outlook thinks the selector is HTML code, and tries to parse it.
That’s why you need to use…
system.web.HttpUtility.HtmlEncode(exception.Message)
This will convert the < and >
to < and >
so that Outlook will display it instead of trying to use it as HTML.
rchabbeh
(rahma)
June 3, 2021, 7:52am
13
i have put the function as you mentioned but I got this error.
postwick
(Paul)
June 3, 2021, 12:29pm
14
What dependencies do you have in your project?