예제 #1
0
 public ActionResult SendEmail(EmailDto model)
 {
     if (ModelState.IsValid)
     {
         SendMessage(model);
         return(RedirectToCurrentUmbracoPage());
     }
     return(CurrentUmbracoPage());
 }
예제 #2
0
        public static void SendConfirmationMessage(EmailDto model)
        {
            MailMessage msg = new MailMessage(new MailAddress("*****@*****.**", "Aplikacja", Encoding.Default),
                                              new MailAddress(model.Email));

            msg.Subject         = "Dziękujemy za wysłanie zapytania";
            msg.SubjectEncoding = Encoding.UTF8;
            msg.IsBodyHtml      = true;
            msg.Body            = "Dziękujemy za wysłanie zapytania '" + model.Subject + "' do Fabryki Domów 'Bogucin' <br /><br />Z poważaniem,<br />Fabryka Domów 'Bogucin'";
            msg.BodyEncoding    = Encoding.UTF8;
            SmtpClient Client = new SmtpClient("194.88.154.132");

            Client.Credentials = new System.Net.NetworkCredential("*****@*****.**", "1990.18,m");
            Client.Send(msg);
        }
예제 #3
0
        public static void SendMessage(EmailDto model)
        {
            MailMessage msg = new MailMessage(new MailAddress("*****@*****.**", "Aplikacja", Encoding.Default),
                                              new MailAddress("*****@*****.**"));

            msg.Bcc.Add(new MailAddress("*****@*****.**"));
            msg.IsBodyHtml      = true;
            msg.Body            = $"Wiadomość od: {model.Name}, email: {model.Email}<br/><br/>{model.Message}";
            msg.BodyEncoding    = Encoding.UTF8;
            msg.Subject         = "Zapytanie ze strony: " + model.Subject;
            msg.SubjectEncoding = Encoding.UTF8;
            SmtpClient Client = new SmtpClient("194.88.154.132");

            Client.Credentials = new System.Net.NetworkCredential("*****@*****.**", "1990.18,m");
            Client.Send(msg);
        }