php - can't use imap_open with symfony 5 - Attempted to call function "imap_open" from namespace "AppController"
one text
I would like read email on a project.
but i have an error when i use "imap_open"
have you an idea ?
/**
* @Route("/", name="app_home")
*/
public function index(): Response
{
$imap = imap_open('{imap.ionos.fr:993/imap/ssl}INBOX', 'j***test@2jcrea.fr', '**password***');
$some = imap_search($imap, 'SUBJECT "HOWTO be Awesome" SINCE "8 August 2008"');
$msgnos = imap_search($imap, 'ALL');
imap_close($imap);
return $this->render('home/index.html.twig', [
'controller_name' => 'HomeController',
]);
}
i have this error :
Attempted to call function "imap_open" from namespace "App\Controller".
Source