using System; namespace GZTW.AyaNova.BLL { #pragma warning disable 1591 /// /// SMS message delivery /// public class GenSMSMessageDelivery : GenMessageDelivery { public GenSMSMessageDelivery():base() { // // TODO: Add constructor logic here // } public override bool Deliver() { if(IsValid) { //attempt delivery // Create a mailman object for sending email. Chilkat.MailMan mailman = new Chilkat.MailMan(); //AYANVA.CB1052023_c9TZbuFYBd7f mailman.UnlockComponent("AYANVA.CB1052023_c9TZbuFYBd7f"); // Set the SMTP server hostname. mailman.SmtpHost = Host;//"mail.ayanova.com"; //Case 515 mailman.SmtpPort = Port; //case 1136 if (GZTW.AyaNova.BLL.AyaBizUtils.GlobalSettings.NotifySMTPUseSSL) mailman.SmtpSsl = true; if (GZTW.AyaNova.BLL.AyaBizUtils.GlobalSettings.NotifySMTPUseTLS) mailman.StartTLS = true; mailman.SmtpUsername=Login; mailman.SmtpPassword=Password; // Create a simple email. Chilkat.Email email = new Chilkat.Email(); email.Body = AyaBizUtils.ReplaceBareLineFeeds(Message);//case 4180 email.Subject = Subject; //case 1601 if (ToAddress.Contains(";")) ToAddress = ToAddress.Replace(";", ","); if (ToAddress.Contains(",")) email.AddMultipleTo(ToAddress); else email.AddTo("",ToAddress); email.From = FromAddress;//Case 452 // Send mail. bool success; success = mailman.SendEmail(email); if (success) { this.mFailedDelivery=false; return true; } else { this.mFailedDelivery=true; this.mError=mailman.LastErrorText; return false; } } return false; } public override bool IsValid { get { if(this.Login=="" || this.Password=="" || this.Host=="" || this.ToAddress=="" || this.FromAddress=="" || (this.Message=="" && this.Subject=="")) { this.mFailedDelivery=true; this.mError="SMS delivery error: One or more required fields empty, undeliverable"; return false; } return true; } } } #pragma warning restore 1591 }