我的 aspx 页面包含一些下拉列表和图表,当我尝试发送它时,它工作正常,但在收到的电子邮件中它不包括图表和选定的下拉项目。请帮助我
这是我的代码..
protected void Button1_Click(object sender, EventArgs e)
{
//create the mail message
MailMessage mail = new MailMessage();
//set the addresses
mail.From = new MailAddress("vprajapat@nvidia.com");
mail.To.Add("vprajapat@nvidia.com");
//set the content
mail.Subject = "This is an email";
//screen scrape the html
string html = ScreenScrapeHtml("http://localhost:60275/WebSite5/Default2.aspx");
mail.Body = html;
mail.IsBodyHtml = true;
//send the message
SmtpClient smtp = new SmtpClient("smtp.nvidia.com", 25);
//smtp.EnableSsl = true;
smtp.UseDefaultCredentials = true;
smtp.Send(mail);
}
public static string ScreenScrapeHtml(string url)
{
WebRequest objRequest = System.Net.HttpWebRequest.Create(url);
StreamReader sr = new StreamReader(objRequest.GetResponse().GetResponseStream());
string result = sr.ReadToEnd();
sr.Close();
return result;
}