yEncoding = System.Text.Encoding.UTF8; System.Web.Mail.SmtpMail.SmtpServer = strSMTPServer; System.Web.Mail.SmtpMail.Send(message); } }
bState = true; } catch (Exception ex) { System.IO.File.AppendAllText("C:\\Mail_Log.ini", string.Format("{0:yyyy/MM/dd HH:mm:ss}\r\n{1}\r\n\r\n", DateTime.Now, ex.Message)); bState = false; strErrorMsg = ex.Message; }
return bState; }
//测试发送邮件
}
邮件在webconfig文件中配置如下:

|