| Author |  | 
      
        | gallazoltan Newbie
 
  
 
 Joined: 14 March 2025
 Location: Hungary
 Online Status: Offline
 Posts: 1
 | 
          Hi, I'm using the 9.8.1 build, and trying to use the autologin feature. When I try the example code from the documentation,
           | Posted: 14 March 2025 at 2:07am | IP Logged |   |  
           | 
 |  
 Fatal error: Uncaught Error: Class "Aurora\System\Api" not found in /web/www/webmail/autologin.php:6 Stack trace: #0 {main} thrown in /web/www/webmail/autologin.php on line 6
 
 
 My code:
 
 
| Code: 
 
    
    | 
      
       | <?php
 $sUserLogin = "my@email.com";
 $sUserPassword = "mypassword";
 include __DIR__.'./system/autoload.php';
 \Aurora\System\Api::Init();
 $aData = \Aurora\System\Api::GetModuleDecorator('Core')->Login($sUserLogin, $sUserPassword);
 if (isset($aData['AuthToken']))
 {
 $sAuthToken = $aData['AuthToken'];
 setcookie('AuthToken', $sAuthToken, time()+3600, "/webmail/");
 \Aurora\System\Api::Location('../');
 }
 exit();
 ?>
 
 |  |  |  
 Do you have any ideas about this?
 Thanks in advance!
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Igor AfterLogic Support
 
  
 
 Joined: 24 June 2008
 Location: United States
 Online Status: Offline
 Posts: 6168
 | 
          Is the code located in the same directory where WebMail Lite resides? Most likely, you need to adjust the path here:
           | Posted: 14 March 2025 at 2:48am | IP Logged |   |  
           | 
 |  
 
 
| Code: 
 
    
    | 
      
       | include __DIR__.'./system/autoload.php'; |  |  |  
 The most straightforward option would be to supply the absolute path to system/autoload.php file, for example:
 
 
 
| Code: 
 
    
    | 
      
       | include '/var/www/webmail/system/autoload.php'; |  |  |  
 --
 Regards,
 Igor, Afterlogic
 | 
       
        | Back to Top |     | 
       
       
        |  |