コード例 #1
0
ファイル: Program.cs プロジェクト: VillyIb/DropPointUpdate
        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);
            }
        }