Search The ForumSearch   RegisterRegister  LoginLogin

General Issues

 AfterLogic Forum : General Issues
Subject Topic: Unable to check the unread mails, since a Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
inform_sabya
Newbie
Newbie
Avatar

Joined: 20 January 2011
Location: India
Online Status: Offline
Posts: 18
Posted: 27 January 2011 at 4:06am | IP Logged Quote inform_sabya

My Code
============================================================ ====
string webMailProPath = ConfigurationManager.AppSettings["WebMailProPath"];
string webMailProURL = ConfigurationManager.AppSettings["WebMailProURL"];
Integration integration = new Integration(webMailProPath, webMailProURL);

//Getting web mail password from DB
ISM.DRM.Common.User _theUser = new ISM.DRM.Common.User();
string webMailPassword =
Convert.ToString(_theUser.GetWebMailPassword(DRMSession.User .UserID));

WebmailSettings settings = (new
WebMailSettingsCreator()).CreateWebMailSettings();
             MailBee.ImapMail.Imap.LicenseKey = (settings.LicenseKey.Length >=
39) ? settings.LicenseKey.Substring(0, 39) : settings.LicenseKey;

             if
(integration.UserExists(Convert.ToString(DRMSession.User.Int ernalEmail),
Convert.ToString(DRMSession.User.InternalEmail), webMailPassword))
             {
                // Check webmail password is active or not
                if (!String.IsNullOrEmpty(webMailPassword))
                {
                     Imap mailer = new Imap();
                     //Connect to the server, login and select inbox.
                     
mailer.Connect(Convert.ToString(ConfigurationManager.AppSett ings["IncomingIMAP"]
));
                     
mailer.Login(Convert.ToString(DRMSession.User.InternalEmail) , webMailPassword,
AuthenticationMethods.Regular);
                     mailer.SelectFolder("INBOX");
                     //Download the latest messages.
                      if (mailer.MessageCount > 0)
                      {
                          
mailer.DownloadEntireMessages(mailer.MessageCount.ToString() + ":*", false);
                     }
                     //Disconnect from the server.
                     mailer.Disconnect();
                }
             }
============================================================ ====
Back to Top View inform_sabya's Profile Search for other posts by inform_sabya
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6104
Posted: 27 January 2011 at 4:46am | IP Logged Quote Igor

Thanks for sharing! It might become a useful start for someone doing the similar
thing. I don't see what kind of problems you're having with this though.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide