Reputation: 185
The mail target is below is what i have currently. I would like to bold the text "Date" and "Calling Class" in the email body. What is the best approach for this? Thanks.
<target name="gmail" type="Mail"
smtpServer="smtp.gmail.com"
smtpPort="587"
smtpAuthentication="Basic"
smtpUsername="xxxxxx"
smtpPassword="xxxxxx"
from="xxxxxx"
to="xxxxxx"
enableSsl="true"
html ="true"
replaceNewlineWithBrTagInHtml ="true"
subject="Example - ERROR - ${exception:format=Message}"
body="Date:${longdate}${newline}Calling Class: ${callsite}"/>
Upvotes: 2
Views: 1884
Reputation: 1375
I'm using NLog version: 4.5.11 with NLog.MailKit version 3.0.0.
This worked for me:
body="Date:<strong>${longdate}</strong>${newline}
Calling Class: <strong>${callsite}</strong>"
Note that I escaped the less than and greater than characters.
Upvotes: 2
Reputation: 18685
Try this:
body="Date:<strong>${longdate}</strong>${newline}
Calling Class: <strong>${callsite}</strong>"
Upvotes: 1