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;
   }

相关文章:

  • 2022-12-23
  • 2022-01-01
  • 2021-11-18
  • 2021-11-30
  • 2021-06-19
  • 2021-04-27
猜你喜欢
  • 2021-05-05
  • 2021-04-14
  • 2021-11-25
  • 2022-12-23
  • 2021-12-06
  • 2022-01-12
  • 2021-06-16
相关资源
相似解决方案