Example #1
0
 public bool SendMail(string Subject, string Body, bool HighPriority, string Attachment, string To, string From, string DisplayName, ref string errors)
 {
     if (String.IsNullOrWhiteSpace(To))
     {
         Logger.LogError(String.Format("Cannot add an empty To address to email with subject: {0}", Subject));
         return(false);
     }
     ToAddresses.Clear();              // need to clear any existing addresses that may have been added
     Logger.LogDebug(String.Format("Adding address: {0}", To));
     ToAddresses.Add(To);
     return(SendMail(Subject, Body, HighPriority, Attachment, ToAddresses, From, DisplayName, AuthAccount, AuthPasswrd, ref errors));
 }
Example #2
0
        public bool SendMail(string Subject, string Body, bool HighPriority, string Attachment, string To, string CC, string From, string DisplayName, string Account, string Password, ref string errors)
        {
            if (String.IsNullOrWhiteSpace(To))
            {
                Logger.Log(EnLogLevel.ERROR, String.Format("Cannot add an empty To address to email with subject: {0}", Subject));
                return(false);
            }
            ToAddresses.Clear();  // need to clear any existing addresses that may have been added
            ToAddresses.Add(To);

            CCAddresses.Clear();
            CCAddresses.Add(CC);

            return(SendMail(Subject, Body, HighPriority, Attachment, ToAddresses, From, DisplayName, Account, Password, ref errors));
        }