Пример #1
0
        private void ApplicationErrorMail(Exception ex)
        {
            string errorMessage = "Error description:\r\n" + ex;

            var fromAddress = new MailAddress("*****@*****.**", "FlyCycle Bot");
            var toAddress   = new MailAddress("*****@*****.**");

            var subject = "Sidfel!";
            var body    = errorMessage + " Please reestablish the webpage asap";

            WebShopController.SendMail(fromAddress, toAddress, subject, body, MailPriority.High);
        }
Пример #2
0
        private void SendForm()
        {
            MailAddress fromAddress = new MailAddress(txtEmail.Text, $"{txtFirstName.Text} {txtForLastName.Text}");
            string      txtFromBody =
                $"Förnamn:{txtFirstName.Text},\n\r" +
                $"Efternamn:{txtForLastName.Text}\n\r" +
                $"E-post:{txtEmail.Text}\n\r" +
                $"Mail inehåll:\n\r" + txtMailContent.Text;
            string      DroppDownAlternative = ddlOptions.Text;
            MailAddress toAddress            = new MailAddress("*****@*****.**", "FlyCycle Suport");

            WebShopController.SendMail(fromAddress, toAddress, DroppDownAlternative, txtFromBody);
        }
Пример #3
0
        private void SendComfirmationMail(SalesOrderHeader salesOrderHeader, Customer customer)
        {
            try
            {
                var subject = "Thank you for ordering form FlyCycles";
                var body    = $"We have recived your order with the order ID {salesOrderHeader.SalesOrderNumber}.\r\n" +
                              $"Best regards\r\n" +
                              $"FlyCycles";

                WebShopController.SendMail(WebShopController.SuportMail,
                                           new MailAddress(customer.EmailAddress, $"{customer.FirstName} {customer.LastName}"), subject, body);
            }
            catch (Exception ex)
            {
                // TODO: Logg order confirm mail error.

                panelMail.Visible      = false;
                panelMailError.Visible = true;
            }
        }