Esempio n. 1
0
        public static SendEmailResult SendEmail(System.Net.Mail.MailMessage message)
        {
            message.BodyEncoding = Encoding.UTF8;
            message.IsBodyHtml = true;
            SmtpClient mailClient = new SmtpClient();
            var log = new SendEmailResult() { Message = message };
            try
            {
                mailClient.Send(message);
            }
            catch (Exception ex)
            {
                log.Exception = ex;
            }

            return log;
        }
Esempio n. 2
0
        public static SendEmailResult SendEmail(System.Net.Mail.MailMessage message)
        {
            message.BodyEncoding = Encoding.UTF8;
            message.IsBodyHtml = true;
            SmtpClient mailClient = new SmtpClient();

            var log = new SendEmailResult() { Message = message };
            try
            {
                mailClient.Send(message);
            }
            catch (Exception ex)
            {
                log.Exception = ex;
                DIYFEWeb.Models.ErrorModel err = new DIYFEWeb.Models.ErrorModel();
                err.InsertErrorNoMail(ex, 0);
            }

            return log;
        }
Esempio n. 3
0
        public static SendEmailResult SendEmail(System.Net.Mail.MailMessage message)
        {
            message.BodyEncoding = Encoding.UTF8;
            message.IsBodyHtml   = true;
            SmtpClient mailClient = new SmtpClient();
            var        log        = new SendEmailResult()
            {
                Message = message
            };

            try
            {
                mailClient.Send(message);
            }
            catch (Exception ex)
            {
                log.Exception = ex;
            }

            return(log);
        }
Esempio n. 4
0
        public static SendEmailResult SendEmail(System.Net.Mail.MailMessage message)
        {
            message.BodyEncoding = Encoding.UTF8;
            message.IsBodyHtml   = true;
            SmtpClient mailClient = new SmtpClient();

            var log = new SendEmailResult()
            {
                Message = message
            };

            try
            {
                mailClient.Send(message);
            }
            catch (Exception ex)
            {
                log.Exception = ex;
                DIYFEWeb.Models.ErrorModel err = new DIYFEWeb.Models.ErrorModel();
                err.InsertErrorNoMail(ex, 0);
            }

            return(log);
        }