public Task <TranStatus> SendMail(SendMailModel model)
 {
     using (mailRepository = new MailRepository())
     {
         return(mailRepository.SendMail(model));
     }
 }
 public static void Jarigen()
 {
     MailRepository mr = new MailRepository();
     List<Klant> jarigen = new List<Klant>();
     jarigen = mr.GetJarigen();
     foreach(Klant k in jarigen)
     {
         mr.SendMail(k);
     }
 }
        public static void Jarigen()
        {
            MailRepository mr      = new MailRepository();
            List <Klant>   jarigen = new List <Klant>();

            jarigen = mr.GetJarigen();
            foreach (Klant k in jarigen)
            {
                mr.SendMail(k);
            }
        }
        static void Main(string[] args)
        {
            var mailRepository = new MailRepository("smtp.gmail.com", "imap.gmail.com", 993, true, "youremailhere", "youremailpassword");
            var allmails       = mailRepository.GetAllMails();

            foreach (var email in allmails)
            {
                Console.WriteLine(email);
            }

            mailRepository.SendMail("Testing smtp", "Hello world");

            mailRepository.sendMailwithAttachments("Testing smtp", "Hello world");

            mailRepository.readMailAttachments();
        }