Exemplo n.º 1
0
        public void Send(Contact contact)
        {
            string subject = "Request for free InFlow Trial";
            string message = "<p>Name: " + contact.Name+"</p><p>Company/Organization: "+contact.Company+"</p><p>Promotion Code: "+contact.PromoCode+"</p>";
            MailMessage mail = new MailMessage(
                contact.Mail,
                Properties.Settings.Default.ToEmail,
              subject,
                message);
            mail.IsBodyHtml = true;
            SmtpClient mailClient = new SmtpClient(Properties.Settings.Default.SMTPHostname, Convert.ToInt32(587));
            mailClient.Credentials = new System.Net.NetworkCredential(Properties.Settings.Default.SMTPUsername, Properties.Settings.Default.SMTPPassword);
            mailClient.Send(mail);

            string response = "<p>Dear "+contact.Name+"!</p><p>Thank you for your interest in a free InFlow trial version. We will process your request and contact you accordingly.</p><p>Yours sincerely,</p><p>StrICT Solutions Service Team</p>";
            mail = new MailMessage(
                            Properties.Settings.Default.ToEmail,
                            contact.Mail,
                          subject,
                            response);
            mail.IsBodyHtml = true;
            mailClient = new SmtpClient(Properties.Settings.Default.SMTPHostname, Convert.ToInt32(587));
            mailClient.Credentials = new System.Net.NetworkCredential(Properties.Settings.Default.SMTPUsername, Properties.Settings.Default.SMTPPassword);
            mailClient.Send(mail);




        }
Exemplo n.º 2
0
        public ActionResult Contact(ContactViewModel contactVM)
        {
            if (!ModelState.IsValid)
            {
                return View(contactVM);
            }

            var contact = new Contact
            {
                Mail = contactVM.Mail,
                Name = contactVM.Name,
                Company = contactVM.Company,
                PromoCode = contactVM.PromoCode
            };

            new Email().Send(contact);

            return RedirectToAction("ContactConfirm");
        }