I'm sending attached mail with my web project.I use following code to give the local path
using (StreamReader reader = new StreamReader(Server.MapPath("~/EmailStyle/TD-emailForCus.html")))
{
body = reader.ReadToEnd();
}
then this works properly.but I want to do like this.
stirng mypath = stirng.Format("~/EmailStyle/TD-emailForCus.html");
using (StreamReader reader = new StreamReader(Server.MapPath(mypath)))
{
body = reader.ReadToEnd();
}
when I do this, it does not work properly.how can I give a map path like this.hope your help.thanx.
do like this.get your full
Server.MapPath()
to a variable like this and then call it,this will help to you.