Jump to content
Software FX Community

How to send embedded Chartx on web page as email body?


dayiku

Recommended Posts

I am trying to send an email to a user after a report has been run. I want to send the web page including the chart in the body of the email.

So far i have been working with the webrequest object to get the information. However, i am faced with one significant problem and that is the image for the chart is not included in the email.

Please see a sample of my code below

private string HttpContent(string url)<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

  {

  System.Net.WebRequest objRequest = System.Net.HttpWebRequest.Create(url);

  StreamReader sr = new StreamReader(objRequest.GetResponse().GetResponseStream());

 

  string result = sr.ReadToEnd();

  sr.Close();

  return result;

  }

 

Can somebody tell me how to send a web page contaning a chart as an email body?

 

Thanks,

 

Link to comment
Share on other sites

Well, what I think you can do, is to create a web page that will host the chart in a physical location. Then you can try to embed this page as a frame in your mails body (im not pretty sure if you can do that in a mails body). So, you can try to set to the mails body text, the full HTML text that will define yor inner webpage.

 replace the hello world space within an iframe or frame pointing to your chart web page.

mail.BodyFormat = MailFormat.Html;mail.Body = "<html><body> Hello World </body></html>";

Hope this helps.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...