Exemplo n.º 1
0
        private static void SendErrorMail(string subject, string body)
        {
            string toMail = ConfigurationGeneral.ErrorMailReciever;
            MailAddress sender = new MailAddress(ConfigurationGeneral.ErrorMailSender);
            using (var mailcontext = new MailContext { SettingsSuppressExceptions = true })
            {
                //mailcontext.BccList = BccList;
                //mailcontext.CcList ;
                mailcontext.From = sender;
                //mailcontext.ReplyToList =
                mailcontext.Sender = sender;
                mailcontext.ToList.Add(new MailAddress(toMail));

                mailcontext.Send(subject, body);
            }
        }