MailDefinition Outside of ASP.Net Application
<p>I'm looking to write a C# console app that will, in the process of running send out emails. I have the emails going out simply by doing something like:</p>

<pre><code>     MailMessage message = new MailMessage("foo@foo.com", "bar@bar.com", "Test message", "Test message content");
     message.IsBodyHtml = true;
     message.Body = "&lt;a href=\"http://www.daringfireball.net\"&gt;DaringFireball.net&lt;/a&gt;";
     SmtpClient client = new SmtpClient("localhost"); // Your host here

     try
     {
        client.Send(message);
     }
     catch (Exception e)
     {
        Console.WriteLine("There was an error trying to send the message: " + e.ToString());
     }
</code></pre>

<p>I was trying to find a way to do this with MailDefinition because these emails might be longer, but in the process of doing that I ran into a little problem. The CreateMailMessage method requires a System.Web.UI.Control which I don't have because I'm not an ASP.Net Application.</p>

<p>Has anyone run into this problem? Or found a better way of doing this?</p>

<p>Thanks</p>
