Reputation: 1555
I have an email template in a file called template.html, how can i use it as mail body in asp.net?
Upvotes: 1
Views: 4033
Reputation: 31
You can use this:
File.ReadAllText("template.html")
//This is to read template.html then you can pass this through
//formatemail() function if you have or
//message.body = File.ReadAllText("template.html");
Upvotes: 3
Reputation: 73594
There's a sample here with code.
Or you could use the MailDefinition class.
Upvotes: 3