| Author |  | 
      
        | eloyucu Newbie
 
  
  
 Joined: 28 December 2015
 Location: Spain
 Online Status: Offline
 Posts: 2
 | 
          Hello everyone.
           | Posted: 28 December 2015 at 6:05pm | IP Logged |   |  
           | 
 |  
 I am trying to integrate afterlogic on a codeigniter web app, and I donīt know if I am doing something wrong or what.
 I could install it perfect, and I can login (receive and send emails) for different email accounts if I use the webmail url, I mean: www.domain.com/webmail.
 The problem is when I try to integrate... I was following these instructions:
 
 http://www.afterlogic.com/products/webmail-pro-php-docs/webmail-integration.htm
 
 But I donīt find the integr.php on the root of my installation.
 
 What I tried to do was to use one of the examples (account-inbox-info.php), thinking that these two lines:
 
 $oApiIntegratorManager = CApi::Manager('integrator');
 $oAccount = $oApiIntegratorManager->loginToAccount($sEmail, $sPassword);
 
 Could be a substitute of integr.php, but seems that doesnīt.
 The authenticate on the line $oApiIntegratorManager->loginToAccount works fine, because it continues showing the view:
 
 <iframe src="http://domain.com/webmail/" id="webmail_iframe" class="col-xs-12"></iframe>
 
 But it shows the login window.
 
 Thank you very much.
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Igor AfterLogic Support
 
  
 
 Joined: 24 June 2008
 Location: United States
 Online Status: Offline
 Posts: 6168
 | 
          The documentation you're referring to is outdated, not sure how exactly you've found it as I'm positive it's not linked anywhere on our web site. Anyway, please make sure you're checking current documentation available at:
           | Posted: 28 December 2015 at 10:58pm | IP Logged |   |  
           | 
 |  
 Logging in programmatically (WebMail Lite)
 
 --
 Regards,
 Igor, AfterLogic Support
 
 
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | eloyucu Newbie
 
  
  
 Joined: 28 December 2015
 Location: Spain
 Online Status: Offline
 Posts: 2
 | 
          Hi Igor, thanks for reply.
           | Posted: 29 December 2015 at 8:44am | IP Logged |   |  
           | 
 |  I found this instructions making this search on google: how to integrate afterlogic on my php project
 
 https://www.google.es/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=how%20to%20integrate%20afterlogic%20on%20my%20php%20project
 
 I am testing the example and it works fine. I let how I do it, if it can help someone on futures cases:
 
 
 private function makeTheINBOX($sEmail, $sPassword)
 {
 include_once '/var/www/html/webmail/libraries/afterlogic/api.php';
 if (class_exists('CApi') && CApi::IsValid())
 {
 try
 {
 // Getting required API class
 $oApiIntegratorManager = CApi::Manager('integrator');
 
 // attempting to obtain object for account we're trying to log into
 $oAccount = $oApiIntegratorManager->loginToAccount($sEmail, $sPassword);
 if ($oAccount)
 {
 $oApiIntegratorManager->SetAccountAsLoggedIn($oAccount);
 $template["title"> = ucwords("WEBMAIL");
 $template["content"> = $this->load->view('components/webmailer/inbox', $this->data, true);
 $this->load->view('template/backend', $template);
 }
 else
 // login error
 echo $oApiIntegratorManager->GetLastErrorMessage();
 }
 catch (Exception $oException)
 {
 // login error
 echo $oException->getMessage();
 }
 }
 else
 echo 'AfterLogic API isn\'t available';
 }
 
 
 And the view:
 
 <div class="row">
 <iframe src="http://domain.net/webmail/" id="webmail_iframe" class="col-xs-12"></iframe>
 </div>
 <script>
 jQuery(document).ready(function()
 {
 h = jQuery('.page-bar').height();
 jQuery('#webmail_iframe').height(jQuery('.page-content').height()-h-33);
 });
 </script>
 
 
 Thank you a lot.
 
 By the by... I didnīt receive any email advising me about your reply... Are not supposed I should have received an email?
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Igor AfterLogic Support
 
  
 
 Joined: 24 June 2008
 Location: United States
 Online Status: Offline
 Posts: 6168
 | 
          Thank you for sharing this, I'm sure other users will find it useful.
           | Posted: 30 December 2015 at 1:00am | IP Logged |   |  
           | 
 |  
 And yes, I'm quite certain there should be a notification sent out via email.
 
 --
 Regards,
 Igor, AfterLogic Support
 | 
       
        | Back to Top |     | 
       
       
        |  |