原先的代码大概如下:
private void SendMail(string mailAddress, string topics)
{
string message = string.Format("mailto:{0}?subject={1}", mailAddress, topics);
System.Diagnostics.Process.Start(message);//调用进程启动邮件
}
邮件主题有时候出现乱码,解决办法就是对subject后面的参数进行urlencode编码
private void SendMail(string mailAddress, string topics)
{
string message = string.Format("mailto:{0}?subject={1}", mailAddress, System.Web.HttpUtility.UrlEncode(topics));
System.Diagnostics.Process.Start(message);//调用进程启动邮件
}