In this article I am going to explain how to send aspx
or html page as mail body in asp.net c#
StringWriter
sw = new
StringWriter();
string content = null;
Server.Execute(("Test.aspx”), sw);
content = sw.ToString();
content = content.Replace((""
+ "\r"),
"").Replace(("" +
"\n"), "").Trim();
sw.Close();
sw.Dispose();
MailSend obj = new
MailSend();
string Mail_CC, Mail_BCC, Mail_Subject, Mail_Body =
"";
Mail_Subject =
"Test Sharad";
Mail_CC =
gupta.sharad2010@gmail.com;
Mail_BCC =
"";
Mail_Body =
(content.Replace("</body>",
"").Replace("</html>",
"") + "
<br/>");
|
You can use "Mail_Body
" string as your mail body.
No comments:
Post a Comment