public void InsertEmailStatus(SendEmail objmodel)
        {
            int intResult = 0;

            try
            {

                SendEmail objTblUser = new SendEmail();
                objTblUser.SenderEmailAddress = objmodel.SenderEmailAddress;
                objTblUser.RecipientEmailAddress = objmodel.RecipientEmailAddress;
                objTblUser.Subject = objmodel.Subject;
                objTblUser.Body = objmodel.Body;
                objTblUser.DeliveryMethod = objmodel.DeliveryMethod;
                objTblUser.DeliveryTime = objmodel.DeliveryTime;
                objTblUser.Status = objmodel.Status;
                objTblUser.SendDate = objmodel.SendDate;
                dbmeals.SendEmails.Add(objTblUser);
                intResult = dbmeals.SaveChanges();

            }
            catch (Exception ex)
            {

            }
        }
        public void SendBulkMail(List<SendEmail> Receivers, string EventType)
        {
            string sender = "*****@*****.**";
            string subject = ""; string Body = "";
            string receiver = "";
            SendEmail SendEmail = new SendEmail();

            if (EventType == "Insert")
            {
                subject = "Data Has Been Inserted...!!!!";
                Body = "The Record has been inserted to the Data Base with selected Table to be watched";

            }
            else if (EventType == "Update")
            {
                subject = "Data Has Been Update...!!!!";
                Body = "The Record has been Updated to the Table with selected Table to be watched";

            }
            SendEmail.SenderEmailAddress = sender;
            SendEmail.Status = "Success";
            SendEmail.SendDate = DateTime.Now.Date;
            SendEmail.Subject = subject;
            SendEmail.Body = Body;
            SendEmail.DeliveryTime = DateTime.Now;
            try
            {
                MailMessage mail = new MailMessage();
                SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com");
                mail.From = new MailAddress(sender);
                for (int i = 0; i < Receivers.Count; i++)
                {
                   // receiver = Convert.ToString(Receivers[i].ReceiverID);
                    SendEmail.RecipientEmailAddress = receiver;
                    SendEmail.DeliveryMethod = "Test";
                    mail.Bcc.Add(receiver);
                    mail.Subject = subject;
                    mail.Body = Body;
                    SmtpServer.Port = 587;
                    SmtpServer.Credentials = new System.Net.NetworkCredential("*****@*****.**", "Debanjan71");
                    SmtpServer.EnableSsl = true;
                    SmtpServer.Send(mail);
                    InsertEmailStatus(SendEmail);
                }

            }
            catch (Exception ex)
            {

            }
        }