Beispiel #1
0
 private void TimerOnTick(object sender, ElapsedEventArgs e)
 {
     try
     {
         //var db = new DataContextConnection();
         //var _playerService = new PlayerService(db);
         //var gameweekOpenEmailRecipients = _playerService.GetPlayersEmailsAcceptedAlerts();
         //var _gameEmailService = new GameEmailService(new SmtpMailService());
         //var gs = new GameService.GameService(db, _gameEmailService);
         //Action gameweekUpdatedAction = () =>
         //{
         //    Parallel.ForEach(gameweekOpenEmailRecipients, (address) =>
         //    {
         //        _gameEmailService.SendGameweekOpenEmail(address, Url.Action("Index", "Home", null, Request.Url.Scheme));
         //    });
         //};
         //gs.UpdateApiData(gameweekUpdatedAction);
         //gs.UpdateResults();
     }
     catch (Exception ex)
     {
         var mailSvc = new SmtpMailService();
         mailSvc.Send("*****@*****.**", "CalledThat Service Exception", ex.ToString());
     }
 }
        public Task SendAsync(IdentityMessage message)
        {
            // Plug in your email service here to send an email.
            var mail = new SmtpMailService();

            return(Task.Run(() => mail.Send(message.Destination, message.Subject, message.Body)));
            //return Task.FromResult(0);
        }