Beispiel #1
0
 public bool SendMail(string TemplateCode, List <string> MailTo = null, List <string> MailCC = null, List <string> MailBCC = null, Dictionary <string, string> SubjectVariables = null, Dictionary <string, string> BodyVariables = null, bool defaultSignature = true)
 {
     try
     {
         if (this.SetSmtpSettings())
         {
             MasterDataAccess objMasterDataAccess = new MasterDataAccess();
             MasterTemplate   objMailTemplate     = objMasterDataAccess.GetTemplate(TemplateCode);
             if (objMailTemplate != null)
             {
                 Constants.MailSend(MailTo, objMailTemplate.MailFrom, objMailTemplate.TemplateSubject, objMailTemplate.TemplateDtls, MailCC, MailBCC, SubjectVariables, BodyVariables, true, defaultSignature);
                 return(true);
             }
             else
             {
                 return(false);
             }
         }
         else
         {
             return(false);
         }
     }
     catch (Exception ex)
     {
         CLogger.WriteLog(ProjectSource.BusinessLayer, ELogLevel.ERROR, "ERROR ocurred in EmailService while calling SendMail Action, Ex.: " + ex.Message);
     }
     return(false);
 }