public bool SendEmail(EmailInfo oInfo, string password) { if (password.Equals(ConfigurationManager.AppSettings["ServicePassword"].ToString())) { Email email = new Email(oInfo); return email.Send(); } return false; }
private bool Send(EmailInfo oEmailInfo) { Email email = new Email(oEmailInfo); if (HttpContext.Current.Request.IsLocal) { return email.SendFromLocal(); } return email.Send(); }
// Methods protected void btnSend_Click(object sender, EventArgs e) { this.Page.Validate("emailSend"); if (this.Page.IsValid) { Email email = new Email(); email.From = this.txtFrom.Text.Trim(); email.To = this.txtTo.Text.Trim(); email.Subject = this.txtSubject.Text.Trim(); email.Body = edtBody.Content; if (base.Request.IsLocal && email.SendThroughWebService()) { base.BuildPopup("Message has been successfully sent to" + email.To); } else if (email.Send()) { base.BuildPopup("Message has been successfully sent to" + email.To); } else { base.BuildPopup(MicNets.Model.Utility.NOTICE_INTERNAL_ERROR); } } }