public ActionResult PasswordRecovery(FormCollection data) { try { var email = data.Get("email"); // get link to reset password var result = client.GetPasswordRequestLink2(email); if (result.ReturnCode == 0) { ModelState.AddModelError(string.Empty, "Cet utilsateur n'existe pas"); return(View()); } else { var Message = Files.ReadContent("PasswordReset.html"); Message = Message.Replace("{email}", result.Email); var callback = Url.Action("ResetPassword", "admin", new { uid = result.UniqueId.Value }, protocol: Request.Url.Scheme); Message = Message.Replace("{url}", callback); Mails.Send("Réinitialiser le mot de passe", result.Email, Message); return(View("~/Views/admin/PasswordResetSuccess.cshtml")); } } catch (Exception ex) { ModelState.AddModelError(string.Empty, ex.Message); return(View()); } }
public void SendEMail(EMail mail) { Mails ml = new Mails(mail.To, mail.Subject, mail.Content, null); ml.Send(); }
private void SendMail2(string subject, string content) { try { Mails ml = new Mails("*****@*****.**", subject, content, null); ml.Send(); } catch (Exception ex) { } }
private void SendMail1(string subject, string content) { try { if (!Config.IsDebug) { Mails ml = new Mails("*****@*****.**", subject, content, null); ml.Send(); } } catch (Exception ex) { } }
private void SendMail1(string subject, string content) { try { if (!Config.IsDebug) { Mails ml = new Mails("[email protected];[email protected]", subject, content, null); ml.Send(); } } catch (Exception ex) { } }
public ActionResult TestSmtp(string to) { try { var subject = "Smtp test mail"; var body = "This is a testing mail.This email sent by DotNetAge."; var app = App.Get(); Mails.Send(!string.IsNullOrEmpty(to) ? to : app.User.Email, subject, body, false); return(Json(true, JsonRequestBehavior.AllowGet)); } catch (Exception e) { return(Json(new { error = e.Message }, JsonRequestBehavior.AllowGet)); } }
private void SendMail(string content) { try { if (Config.IsDebug) { Mails ml = new Mails("[email protected];[email protected]", "【OCR平台实时处理】 开启关闭 提醒警告", content, null); ml.Send(); } } catch (Exception ex) { } }
public override void Process(object sender, RegisterModel e) { var app = App.Get(); var user = app.Users[e.UserName]; user.VaildToken = Guid.NewGuid().ToString(); var uri = app.Context.AppUrl.ToString() + "account/ConfirmEmail/" + user.VaildToken; Mails.Send(e.UserName, "Congratulations", "sys_register", new { dispName = user.DisplayName, user = user.UserName, password = user.Password, confirmUrl = uri, web = app.Webs["home"].Title }); }
private void SendMail(string content) { try { //return; if (Config.IsDebug) { Mails ml = new Mails("*****@*****.**", "【OCR平台实时处理】 开启关闭 提醒警告", content, null); ml.Send(); } } catch (Exception ex) { } }
public ActionResult ValidateEmail(string userName) { var app = App.Get(); var user = app.Users[userName]; user.VaildToken = Guid.NewGuid().ToString(); var uri = app.Context.AppUrl.ToString() + "account/ConfirmEmail?userName="******"&token=" + user.VaildToken; Mails.Send(userName, "Confrim your email address", "sys_validatemail", new { to = user.DisplayName, confirmUrl = uri, web = app.Webs["home"].Title }); return(Json(true, JsonRequestBehavior.AllowGet)); }
protected void btnsubmit_Click(object sender, EventArgs e) { Mails objmail = new Mails(); string tomail = System.Configuration.ConfigurationSettings.AppSettings["TO"]; objmail.To = tomail; objmail.From = txtemail.Text; objmail.Subject = "Golden Education: Contact-Us"; objmail.Body = GetBody(); objmail.Send(); this.txtname.Text = ""; this.txtsubject.Text = ""; this.txtphone.Text = ""; this.txtmsz.Text = ""; reply(); }
public JsonResult MarkDelivered(int id) { try { var usr = (Pharmacies)Session["user"]; client.MarkAsDelivered(id); // send mail to patient var ord = client.GetOrderAsPdf(id, true); var pat = client._GetPatientById(ord.PatientId); var Message = Files.ReadContent("Delivered.html"); var callback = "https://secondavismedical.eu/Downloads/orders/" + ord.Id + ".pdf"; Message = Message.Replace("{url}", callback); Message = Message.Replace("{pharmacy}", usr.CommercialName); Mails.Send("CN°" + ord.OrderNomber + " livrée", pat.AdressEmail, Message); return(Json(new { success = true })); } catch (Exception ex) { return(Json(new { success = false, message = ex.Message })); } }
static void Main(string[] args) { // All hosts to be verified string[] hosts = { "alanusdevelopment.com", "google.com.br", "youtube.com", "nead.ugb.edu.br", "192.168.1.1" }; Machine machine = new Machine(); Mails mail = new Mails(); foreach (string host in hosts) { machine.Host = host; var response = machine.IsAvailable(12000); if (response.Status.ToString() == "Success") { Console.WriteLine(host + " is online. It has walked through " + response.Options.Ttl + " " + "routers or gateways"); } else { // Parameters // // string to // string host // string subject // string body mail.Send("*****@*****.**", host + " IS OUT OF CONNECTION", "Hi, the connection with <b>" + host + "</b> was not successfull" + "<br/><b>Details:</b><br/><b>Status:</b>" + response.Status); } } Console.Read(); }
public JsonResult SendQuote(int requestId) { try { var usr = (Pharmacies)Session["user"]; var em = client.MarkAsSent(requestId); var Message = Files.ReadContent("devisDone.html"); var callback = "https://secondavismedical.eu/devis/details/" + requestId; Message = Message.Replace("{url}", callback); Message = Message.Replace("{name}", usr.CommercialName); Mails.Send("Proforma", em, Message); return(Json(new { success = true })); } catch (FaultException ex) { return(Json(new { success = false, message = ex.Message })); } catch (Exception ex) { return(Json(new { success = false, message = ex.Message })); } }
public JsonResult Validate(int id) { try { var usr = (Pharmacies)Session["user"]; client.MarkAsReadyForPayment(id); // send mail to patient var ord = client.GetOrderAsPdf(id, true); var pat = client._GetPatientById(ord.PatientId); var Message = Files.ReadContent("OrderReady.html"); var callback = "https://secondavismedical.eu/orders/details/" + ord.Id; Message = Message.Replace("{url}", callback); Message = Message.Replace("{pharmacy}", usr.CommercialName); Message = Message.Replace("{number}", ord.OrderNomber); Mails.Send("CN°" + ord.OrderNomber + " vérifiée", pat.AdressEmail, Message); return(Json(new { success = true })); } catch (Exception ex) { return(Json(new { success = false, message = ex.Message })); } }
protected void reply() { Mails objmail = new Mails(); string tomail = System.Configuration.ConfigurationSettings.AppSettings["TO"]; objmail.To = txtemail.Text; objmail.From = tomail; objmail.Subject = "Golden Education: Contact-Us"; objmail.Body = thnxbody(); objmail.Send(); Page.RegisterStartupScript("temp", "<script>alert('Thanks, Your Mail sent successfully. we will contact you as soon as possible.')</script>"); this.txtname.Text = ""; this.txtemail.Text = ""; this.txtphone.Text = ""; this.txtmsz.Text = ""; this.txtsubject.Text = ""; }
private void Send(string subject, string body, string to) { Mails.Send(to, subject, body, true); }