I have a small application written in c# as a console app that I want to use to send an email. I was planning on storing the email inside an xml file along with other information that the message will need like a subject. However there seems to be a problem because the XML file doesnt like </br>
characters.
Im wondering what I should do in order to store a html email do I just have to keeo the body html in a seperate html file and then read each line into a StreamReader object?
The easiest way would be to store the HTML content in a CDATA section:
<mail>
<subject>Test</subject>
<body>
<![CDATA[
<html>
...
</html>
]]>
</body>
</mail>
Use a CDATA section, that will contain your email HTML code :
<?xml version="1.0"?>
<myDocument>
<email>
<![CDATA[
<html>
<head><title>My title</title></head>
<body><p>Hello world</p></body>
</html>
]]>
</email>
</myDocument>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With