Ejemplo n.º 1
0
        private static string Test()
        {
            string emails = string.Empty;
            try
            {
                string domainKey = ConfigurationManager.AppSettings["DomainKey"];
                string domainPassword = ConfigurationManager.AppSettings["DomainPassword"];

                GatherEmailByCloudSponge objGatherEmailByCloudSponge = new GatherEmailByCloudSponge();

                List<string> lstFriendsEmail = objGatherEmailByCloudSponge.GetFriendsEmail();
                // List<string> lstFriendsEmail = objGatherEmailByCloudSponge.GetFriendsEmail(domainKey, domainPassword);

                foreach (string item in lstFriendsEmail)
                {
                    try
                    {
                        emails += item+"<:>";
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine("Error : " + ex.StackTrace);
                    }
                }

                emails = emails.Remove(emails.LastIndexOf("<:>"));

            }
            catch (Exception ex)
            {
                Console.WriteLine("Error : " + ex.StackTrace);
            }
            return emails;
        }
        private string GetMails(Api api, ConsentResponse consent)
        {
            string emails = string.Empty;
            try
            {
                

                GatherEmailByCloudSponge objGatherEmailByCloudSponge = new GatherEmailByCloudSponge();

                //List<string> lstFriendsEmail = objGatherEmailByCloudSponge.GetFriendsEmail(mailtype);
                // List<string> lstFriendsEmail = objGatherEmailByCloudSponge.GetFriendsEmail(domainKey, domainPassword);

                List<string> lstFriendsEmail = GetContext(api, consent);

                foreach (string item in lstFriendsEmail)
                {
                    try
                    {
                        emails += item + "<:>";
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine("Error : " + ex.StackTrace);
                    }
                }

                emails = emails.Remove(emails.LastIndexOf("<:>"));

            }
            catch (Exception ex)
            {
                Console.WriteLine("Error : " + ex.StackTrace);
            }
            return emails;
        }