c# - Sending a web page by email programmatically. Image URLs not resolved -
I am writing a SharePoint timer job, which needs to drag the contents of the web page, and email that email To send in the form.
I am using the HttpWebRequest and the HttpWebResponse object to drag the contents.
The functionality of email works fine except for a problem.
The webpage the service renders contains an image in the content of my email.
When the page's HTML is sent as an email, the image URLs within the HTML code are all relative URLs, they are not resolved as a complete URL.
How do I resolve my entire path inside the web page content for an image URL?
Is there a direct way to do this? I do not want to run a Regex on the HTML code to replace all the relative URLs with absolute URLs.
Try adding an element at the top of the retrieving HTML document. As a href attribute, you should use the URL of the page you are retrieving.
Comments
Post a Comment