MailMessage msg = new MailMessage();
msg.To = mailTo; // assumes strEmail was set
msg.Cc = cc;
msg.From = mailFrom ;
msg.Subject = subject;
msg.Priority = priority;
msg.BodyFormat = format;
msg.Body = body;
msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //表示基本验证
msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", Globals.SmtpUsername); //发件人的Email登录用户名
msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", Globals.SmtpPassword); //发件人的Email登录密码
SmtpMail.SmtpServer = Globals.SmtpServer;
try
{
SmtpMail.Send(msg);
bret = true;
}
catch
{
bret = false;
}