protected void btnSend_Click(object sender, EventArgs e) { if (validateData()) { String name = txtName.Text; String email = txtEmail.Text; String message = txtMessage.Text; String phone = txtPhone.Text; String body = this.messageDesign(message, phone, name, email); String subject = "Contactenos"; Entities.Email oEmail = new Entities.Email(); if (oEmail.correoContacto("*****@*****.**", body, subject)) { clearControls(); lblMessageSuccess.Text = "Mensaje enviado correctamente."; lblMessageSuccess.CssClass = "successEmail"; } else { lblMessageSuccess.Text = "Hubo un error a la hora de enviar el mensaje."; lblMessageSuccess.CssClass = "errorEmail"; } } }
private void Send(Email email) { var model = JsonConvert.DeserializeObject<ExpandoObject>(email.Payload, new ExpandoObjectConverter()); var message = new RazorMessage(email.TemplateName, model); var envelope = _messageEnvelopeFactory.GetEnvelope(GetSubject(email.TemplateName), email.Address, message); _messageTransport.Send(envelope); }
public IHttpActionResult Post([FromUri] string id, [FromBody]string emailaddress) { var db = new PetaPoco.Database("AGSoftware"); var a = db.SingleOrDefault<Entities.AspNetUsers>("Select * from AspNetUsers Where Email = @0", emailaddress); if (a != null) { Email email = new Email(ConfigurationManager.AppSettings["EmailHost"]); email.To.Add(a.Email); email.From = "*****@*****.**"; email.Subject = "Username/Password"; email.Body = "<p><strong>Hello</strong></p><p>Username: "******"</p><p>Password: "******"</p>"; email.Send(); return Ok(); } else { return NotFound(); } }
public override int GetHashCode() { return(Name.GetHashCode() ^ PhoneNumber.GetHashCode() ^ Email.GetHashCode() ^ Username.GetHashCode() ^ Id.GetHashCode()); }