Пример #1
0
        /// <summary>
        /// Main function
        /// </summary>
        /// <param name="args">No args</param>
        static void Main(string[] args)
        {
            /*
             *  Example One - Using IDisposable
             *  We'll get the email body here then let it dispose
             */
            using (GuerrillaMail mailOne = new GuerrillaMail())
            {
                /*Get our default email address and do something with it*/
                var myEmailAddress = mailOne.GetMyEmail();
                DoSomethingWithEmail(myEmailAddress);

                /*Get last email and print the text content (body)*/
                var lastEmail = mailOne.GetLastEmail();
                Console.WriteLine(lastEmail.mail_excerpt);
            }


            /*
             *  Example Two - Doing it with a proxy
             *  Print our different emails
             */
            GuerrillaMail mailTwo = new GuerrillaMail("123.123.12:12323");

            Console.WriteLine(mailTwo.GetMyEmail(1));
            Console.WriteLine(mailTwo.GetMyEmail(2));
            Console.WriteLine(mailTwo.GetMyEmail(3));


            /*
             *  Example Three - We're going global
             *  This time we'll make the mail global so we can use it later
             */
            mailThree = new GuerrillaMail();
            DoSomethingElseThatTakesTime();

            /*Oops now we need to get ALL the email we've received*/
            DoSomethingWithEmail(mailThree.GetMyEmail());
            var myEmails = mailThree.GetAllEmails();
        }
Пример #2
0
        /// <summary>
        /// Main function
        /// </summary>
        /// <param name="args">No args</param>
        static void Main(string[] args)
        {
            /*
                Example One - Using IDisposable
                We'll get the email body here then let it dispose
            */
            using (GuerrillaMail mailOne = new GuerrillaMail())
            {
                /*Get our default email address and do something with it*/
                var myEmailAddress = mailOne.GetMyEmail();
                DoSomethingWithEmail(myEmailAddress);

                /*Get last email and print the text content (body)*/
                var lastEmail = mailOne.GetLastEmail();
                Console.WriteLine(lastEmail.mail_excerpt);
            }

            /*
                Example Two - Doing it with a proxy
                Print our different emails
            */
            GuerrillaMail mailTwo = new GuerrillaMail("123.123.12:12323");
            Console.WriteLine(mailTwo.GetMyEmail(1));
            Console.WriteLine(mailTwo.GetMyEmail(2));
            Console.WriteLine(mailTwo.GetMyEmail(3));

            /*
                Example Three - We're going global
                This time we'll make the mail global so we can use it later
            */
            mailThree = new GuerrillaMail();
            DoSomethingElseThatTakesTime();

            /*Oops now we need to get ALL the email we've received*/
            DoSomethingWithEmail(mailThree.GetMyEmail());
            var myEmails = mailThree.GetAllEmails();
        }