protected static void SendEmails(Tuple <int, string, string, string, string>[] messagesInfo)
    {
        for (int i = 0; i < messagesInfo.Length; i++)
        {
            Tuple <int, string, string, string, string> messageInfo = (Tuple <int, string, string, string, string>)messagesInfo[i];
            int    patientID = messageInfo.Item1;
            string orgName   = messageInfo.Item2;
            string email     = messageInfo.Item3;
            string message   = messageInfo.Item4;
            string subject   = messageInfo.Item5;

            try
            {
                SendEmail(orgName, email, subject, message);
                EmailHistoryDataDB.Insert(2, patientID, -1, email, message);
            }
            catch (Exception ex)
            {
                Logger.LogSMSSend(
                    email + Environment.NewLine + Environment.NewLine +
                    message + Environment.NewLine + Environment.NewLine +
                    subject + Environment.NewLine + Environment.NewLine +
                    ex.ToString(),
                    true);

                Logger.LogException(ex, true);
            }
        }
    }
    protected static void SendEmails(Tuple <int, string, string, string, string>[] messagesInfo)
    {
        for (int i = 0; i < messagesInfo.Length; i++)
        {
            Tuple <int, string, string, string, string> messageInfo = (Tuple <int, string, string, string, string>)messagesInfo[i];
            int    bookingID = messageInfo.Item1;
            string orgName   = messageInfo.Item2;
            string email     = messageInfo.Item3;
            string message   = messageInfo.Item4;
            string subject   = messageInfo.Item5;

            try
            {
                if (Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings["LogSMSSending"]))
                {
                    Logger.LogSMSSend(
                        System.Web.HttpContext.Current.Session["DB"].ToString() + Environment.NewLine + Environment.NewLine +
                        email + Environment.NewLine + Environment.NewLine +
                        message + Environment.NewLine + Environment.NewLine +
                        subject + Environment.NewLine + Environment.NewLine,
                        true);
                }

                SendEmail(orgName, email, subject, message);
                EmailHistoryDataDB.Insert(1, -1, bookingID, email, message);
            }
            catch (Exception ex)
            {
                Logger.LogSMSSend(
                    email + Environment.NewLine + Environment.NewLine +
                    message + Environment.NewLine + Environment.NewLine +
                    subject + Environment.NewLine + Environment.NewLine +
                    ex.ToString(),
                    true);

                Logger.LogException(ex, true);
            }
        }
    }