When a fellow developer came over to talk about sending an email from his tool and I had forgotten this little hat trick. When you need to pop up an email in the event your software needed to send you some information (such as an unhandled exception), you can use something like this handy little tool.
public static void CreateEmail(string _to, string _subject,
string _body = “”,
string _cc = “”,
string _bcc = “”)
{
StringBuilder mailTo = new StringBuilder();
mailTo.Append(“mailTo:”).Append(_to);
mailTo.Append(“&subject=”).Append(_subject);
if (!String.IsNullOrEmpty(_body)) mailTo.Append(“&body=”).Append(_body);
if (!String.IsNullOrEmpty(_cc)) mailTo.Append(“&CC=”).Append(_cc);
if (!String.IsNullOrEmpty(_bcc)) mailTo.Append(“&BCC=”).Append(_bcc);
Process.Start(mailTo.ToString());
}
Happy Coding!