public ActionResult SendMail(vm_SendMail sendmail)
        {
            if (!string.IsNullOrEmpty(sendmail.Subscriber.Name) && !string.IsNullOrEmpty(sendmail.Subscriber.Email))
            {
                var newsub = new Subscriber();

                newsub.ID = Guid.NewGuid();
                newsub.Name = sendmail.Subscriber.Name;
                newsub.Email = sendmail.Subscriber.Email;
                newsub.City = sendmail.Subscriber.City;
                newsub.SubscriberType = sendmail.Subscriber.SubscriberType;

                _subscriberRepo.Save(newsub);
                ViewBag.StatusMessage = "Success";
                return View();
             }

            if (!string.IsNullOrEmpty(sendmail.Newsletter.Subject) && !string.IsNullOrEmpty(sendmail.Newsletter.Message))
            {
                sendmail.Newsletter.ID = Guid.NewGuid();
                sendmail.Newsletter.Date = DateTime.Now;

                _newsletterRepo.Save(sendmail.Newsletter);

                List<Subscriber> emails = _subscriberRepo.FindAll(e => e.SubscriberType == sendmail.Subscriber.SubscriberType).ToList();

                foreach (var email in emails)
                {
                    try
                    {
                        MailMessage mail = new MailMessage();
                        SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com");

                        mail.From = new MailAddress("*****@*****.**");
                        mail.To.Add(email.Email);
                        mail.Subject = sendmail.Newsletter.Subject;
                        mail.Body = sendmail.Newsletter.Message;

                        SmtpServer.Port = 587;
                        SmtpServer.Credentials = new System.Net.NetworkCredential("*****@*****.**", "jctest123456");
                        SmtpServer.EnableSsl = true;

                        SmtpServer.Send(mail);
                        ViewBag.StatusMessage = "Mail skickat";
                    }
                    catch (Exception ex)
                    {
                        ViewBag.StatusMessage = ex;
                    }
                }
                return View();

            }
            return View();
        }
        public ActionResult SendMail()
        {
            var sendmail = new vm_SendMail();

            return View(sendmail);
        }