Author |
|
Punkus Guest Group
Joined: 10 November 2003
Online Status: Online Posts: 262
|
Posted: 01 June 2006 at 10:23am | IP Logged
|
|
|
Hello,
We are planing to develop web based(asp.net 2.0)map client and now trying various comercial components , and your mailbee library seems very easy to use, great product.
But i ran into a problem :
The idea was to open connection to imap server and login only once per user session to minimize usage of resources,
so what i tried, is to after successfull connection and user login to imap server, put Imap instance to SessionState, that it would be accessible later. But, on next request, when accessing it, property IsAborted becomes set to "true".
Here is som code listing :
Login.aspx :
Imap imapClient = new Imap();
imapClient.RaiseEvents = false;
imapClient.ThrowExceptions = false;
try
{
if (!imapClient.Connect(this.ServerName, this.Port))
{
this.SetStatusMessage(Resources.Common.error_ConnectFailed);
imapClient.Dispose();
imapClient = null;
return;
}
if (imapClient.Login(this.UserName, this.Password))
{
FormsAuthentication.RedirectFromLoginPage(this.UserName, false);
this.Session.Add("ImapClient", imapClient);
return;
}
else
{
this.SetStatusMessage(Resources.Common.error_LoginFailed);
this.Trace.Write("Login", string.Format("Failed login for user {0}", this.UserName));
}
}
catch (MailBee.MailBeeException E)
{
//.../
}
Everything goes ok here.Login returns true and client gets redirected to default.aspx
Default.aspx OnLoad :
this.imapClient = Session["ImapClient"] as Imap;
if (this.imapClient == null )
{
FormsAuthentication.SignOut();
FormsAuthentication.RedirectToLoginPage();
}
/*debugger shows this.imapClient.IsAborted == true*/
if(!this.imapClient.IsLoggedIn)
{
/*comes here.Also Isconnected is false*/
}
Am i doing something wrong? Why does object gets aborted, is there any workaround?
thanks in advance for any help.
If this issue is resolvable, we would gladly purchase your product.
|
Back to Top |
|
|
Alex AfterLogic Support
Joined: 19 November 2003
Online Status: Offline Posts: 2206
|
Posted: 01 June 2006 at 1:41pm | IP Logged
|
|
|
That's strange.. We just created simple application which does the same and it works fine. Could you please enable logging of IMAP session into a file and us the log for examination?
Code:
Imap imapClient = new Imap();
imapClient.Log.Filename = @"C:\log.txt"
imapClient.Log.Enabled = true;
...
|
|
|
Make sure your application has permissions to write into the specified location.
Regards,
Alex
|
Back to Top |
|
|