I'm using shared resources throughout my program and I'm making a new tool that loops through and does updates. I've got a lot of places where I call a class from a control that sends emails and the rest of the code is written so I don't really want to change it. However, I can't work out what to pass in to CreateMailMessage to replace System.web.ui.control as it falls over when the class is called from a console application (works fine from the .net web app)
public static void SendMail(String emailTo, String Subject, String Template, ListDictionary Replace)
{
MailDefinition md = new MailDefinition();
md.From = "support@jkkkjjk.com";
md.IsBodyHtml = true;
md.Subject = Subject;
string body = DBCommon.getEmailTemplate(Template);
MailMessage msg = md.CreateMailMessage(emailTo, Replace, body, new System.Web.UI.Control());
SmtpClient mailer = new SmtpClient();
mailer.Host = "relay.plus.net";
mailer.Send(msg);
}