Support Tickets - Error #2 when running email.php

Error #2 when running email.php

HelpDesk 04.07.2016 372 Support Status: Closed Solution: Yes Netthandel


The email.php now runs longer, but it is still a bug there.

Parse error: syntax error, unexpected '[' in /home/installdomain/class/class.imap.php on line 134

Line 134 says: $emails = [];

I don't see any error there, but it is reported.

It's from this area in class.imap.php:

 * returns unseen emails in the current folder
*
* @return array messages
* @param $withbody without body
*/
public function getUnreadMessages($withbody=true){
$emails = [];
$result = imap_search($this->imap, 'UNSEEN');
if($result){
foreach($result as $k=>$i){
$emails[]= $this->formatMessage($i, $withbody);
}
}
return $emails;
}

Can you see what causes this?


Replies (10)

  • avatar Jerome

    Could be your php version.

    Please download the package again and replace the class/class.imap.php file.

    04.07.2016 0
  • avatar Netthandel

    PHP Version 5.3.3-7+squeeze19

    Error still persists after upload of last class/class.imap.php file

    04.07.2016 0
  • avatar Jerome

    Are you sure PHP imap extension is installed and compiled correctly?

    I run some tests with PHP 5.2, 5.3, 5,4 and PHP 7.

    05.07.2016 0
  • avatar Netthandel

    I don't know.

    PHPinfo: says:

    IMAP c-Client Version2007e
    05.07.2016 0
  • avatar Jerome

    Please send me FTP and operator logins via following form: https://www.jakweb.ch/access-form

    05.07.2016 0
  • avatar Netthandel

    What line in phpinfo; says what you need to know?

    It also says:

    Protocolsdict, file, ftp, ftps, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtsp, scp, sftp, smtp, smtps, telnet, tftp
    05.07.2016 0
  • avatar Jerome

    Thank you for your information. I have uploaded the class/class.imap.php file again (without changes) and there is no error message so far, please give it a go.

    05.07.2016 0
  • avatar Netthandel

    It seam to work. Can the FTP software be the issue then? Binary versus ASCII

    I am 100% sure I downloaded last pachage and uploaded the last class.imap.php file.

    I got a response via email now that a support ticket was opened, so I believe it works now. I'll test once more to just make sure. ;-)

    05.07.2016 0
  • avatar Netthandel

    It works excellent :-)

    Thank you again. Super support! I really appreciate it!

    05.07.2016 0
  • avatar Jerome

    Glad it works now, could be an FTP issue, if you can, use Auto mode and not manual mode in your ftp program.

    *** Ticket closed ***

    05.07.2016 0