示例#1
0
        /// <summary>
        /// Get an email connection
        /// </summary>
        /// <returns>An email connection</returns>
        private static ImapClient GetClient()
        {
            string host     = EmailConfig.GetHost();
            string username = EmailConfig.GetUserName();
            string password = EmailConfig.GetPassword();

            return(ClientFactory.GetEmailClient(host, username, password, 993, 10000, true, true));
        }
        public void BasicConnectionTest()
        {
            string host     = EmailConfig.GetHost();
            string username = EmailConfig.GetUserName();
            string password = EmailConfig.GetPassword();
            int    port     = EmailConfig.GetPort();

            using (EmailDriver test = new EmailDriver(host, username, password, port, 10000, true, true))
            {
                test.EmailConnection.NoOp();
            }
        }
示例#3
0
        public static void Cleanup()
        {
            string host     = EmailConfig.GetHost();
            string username = EmailConfig.GetUserName();
            string password = EmailConfig.GetPassword();
            int    port     = EmailConfig.GetPort();
            bool   isSsl    = EmailConfig.GetEmailViaSSL();
            bool   checkSsl = EmailConfig.GetEmailSkipSslValidation();

            using (EmailDriver driver = new EmailDriver(host, username, password, port, 10000, isSsl, checkSsl))
            {
                driver.SelectMailbox("Inbox");
                foreach (MimeMessage messageHeader in driver.GetAllMessageHeaders())
                {
                    driver.DeleteMessage(messageHeader);
                    Thread.Sleep(100);
                }
            }
        }
        public void GetHostTest()
        {
            string host = EmailConfig.GetHost();

            Assert.AreEqual("localhost", host);
        }
示例#5
0
        public void GetHostTest()
        {
            string host = EmailConfig.GetHost();

            Assert.AreEqual("imap.gmail.com", host);
        }