The issue is i'm trying to get the last email from my email using php, and it works fine locally. But then I uploaded the script to the client's server, and I don't get a response. When I check the logs, I get this:
[12-Feb-2020 08:43:21 location] PHP Warning: imap_open(): Couldn't open stream {<mail>:143/imap}INBOX in /path/triggerCall.php on line 2
[12-Feb-2020 08:43:21 location] PHP Warning: imap_headers() expects parameter 1 to be resource, boolean given in /path/triggerCall.php on line 7
[12-Feb-2020 08:43:21 location] PHP Warning: imap_num_msg() expects parameter 1 to be resource, boolean given in /path/triggerCall.php on line 14
[12-Feb-2020 08:43:21 location] PHP Warning: imap_header() expects parameter 1 to be resource, boolean given in /path/triggerCall.php on line 16
[12-Feb-2020 08:43:21 location] PHP Warning: imap_fetchbody() expects parameter 1 to be resource, boolean given in /path/triggerCall.php on line 20
[12-Feb-2020 08:43:21 location] PHP Warning: imap_close() expects parameter 1 to be resource, boolean given in /path/triggerCall.php on line 40
This is the code:
$inbox = imap_open('{<mail>:143/imap}', '<username>', '<password>');
$headers = imap_headers($inbox);
$last = imap_num_msg($inbox);
$header = imap_header($inbox, $last);
$body = imap_fetchbody($inbox, $last,1);