public CommLogic(MailClient mClient, DoodleClient dClient, TwilioClient tClient, ResponseCallback callback) { mailClient = mClient; doodleClient = dClient; twilioClient = tClient; callbackFn = callback; // Start reading email from the appropriate IMap provider. // This creates its own long-running thread. imapReader = new ImapReader(mailClient.Imap, "INBOX", MessageCallback); }
private void StartGmailClient() { string userName = ConfigurationManager.AppSettings["GMAIL_USERNAME"]; string userPwd = ConfigurationManager.AppSettings["GMAIL_USERPWD"]; if ((null == userName) || (null == userPwd)) { GmailClient = null; return; } ImapAccountInfo imapAccount = new ImapAccountInfo(); imapAccount.UserName = userName; imapAccount.UserPwd = userPwd; imapAccount.Provider = ImapProvider.GMail; SmtpAccountInfo smtpAccount = new SmtpAccountInfo(); smtpAccount.UserName = userName; smtpAccount.UserPwd = userPwd; smtpAccount.Provider = SmtpProvider.GMail; GmailClient = new MailClient(imapAccount, smtpAccount); }