I'm getting error when I'm overwriting the file. And if it is still working can't find to way for close file. Can someone help me please ?
if (System.IO.File.Exists(Server.MapPath("/html/" + htmlname)))
{
System.IO.File.Delete(Server.MapPath("/html/" + htmlname));
System.IO.File.WriteAllText(Server.MapPath("/html/" + htmlname), mailbody);
}
else
{
System.IO.File.WriteAllText(Server.MapPath("/html/" + htmlname), mailbody);
}