Step1: Make a txt (html file) compatible
Step2: Use below NameSpace in your codebehind
(.cs) file
using System.Text;
using System.IO;
Step2: Write code in your cs file to get message
body
protected string MessageBodyFile()
{
string strBody = "";
string root = Server.MapPath("~");
string Template = root + "\\Template\\mailbody.txt";
StringBuilder strb = new StringBuilder();
using (StreamReader rwOpenTemplate = new StreamReader(Template))
{
while (!rwOpenTemplate.EndOfStream)
{
strBody = strb.Append(rwOpenTemplate.ReadToEnd()).ToString();
}
}
return strBody;
}
Comments