davidcahan
asked on
System.Net.Mail.MailMessage: Insert Body from File
The body of my email is fairly complicated HTML. instead of trying to code it all in the code behind file, I'd like to code it in an html file (possibly called BodyOfMessage.htm or BodyOfMessage.txt) and then read/insert the file in as the body of the email.
How do i do this?
How do i do this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
actually...what is that part where you replace the variables? what variables are you replacing
In your HTML file, you could have something like this
<body>
<p>Dear [Fullname],</p>
<p>Thank you for ordering [productName].</p>
</body>
Then you would replace them like template fields.
emailFile.Replace("[FullNa me]", obj.FullName)
emailFile.Replace("[produc tName]", obj.ProductName)
<body>
<p>Dear [Fullname],</p>
<p>Thank you for ordering [productName].</p>
</body>
Then you would replace them like template fields.
emailFile.Replace("[FullNa
emailFile.Replace("[produc
ASKER
ahhh...ok. that's what i thought but i wasn't sure. thanks again
ASKER