How to generate HTML email content with asp.net
<p>I want to send emails in HTML format. How can I use asp.net to generate HTML content for emails.</p>

<ol>
<li>Using output of .aspx page(Tried there was nothing in email body. Must be something in page that can't be used for email)</li>
<li>Using Webcontrol and get web control output and use it as email body.</li>
<li>Using custom http handler so can call handler to get email body.</li>
</ol>

<p>Can you please suggest what would be the best solution?</p>

<p>Some guide or sample reference would be great if know one.</p>

<p>Thanks for all answers:</p>

<p>I am implementing code below:</p>

<pre><code> string lcUrl = "http://localhost:50771/webform1.aspx";

        // *** Establish the request
        HttpWebRequest loHttp =
             (HttpWebRequest)WebRequest.Create(lcUrl);

        // *** Set properties
        //loHttp.Timeout = 10000;     // 10 secs
        loHttp.UserAgent = "Code Web Client";

        // *** Retrieve request info headers
        HttpWebResponse loWebResponse = (HttpWebResponse)loHttp.GetResponse();

        Encoding enc;
        try
        {
            enc = Encoding.GetEncoding(loWebResponse.ContentEncoding);
        }
        catch
        {
            enc = Encoding.GetEncoding(1252);
        }

        StreamReader loResponseStream =
           new StreamReader(loWebResponse.GetResponseStream(), enc);

        string lcHtml = loResponseStream.ReadToEnd();

        loWebResponse.Close();
        loResponseStream.Close();
</code></pre>
