用heroku app查看imap邮件

I get this error when I trying to cal this code on heroku.

Whats the solution within the heroku?

$mbox = imap_open("{imap-baxxxxxxta.net:143}", "*@baxxxx.pw", "0xxxx3");

echo "<h1>Posta kutuları</h1>
";
$folders = imap_listmailbox($mbox, "{imap-bxxxxxxxxxxet:143}", "*");

if ($folders == false) {
    echo "İşlem başarısız oldu<br />
";
} else {
    foreach ($folders as $val) {
        echo $val . "<br />
";
    }
}


Fatal error: Call to undefined function imap_open() in /app/imaptest.php on line 6

Make sure the IMAP extension for PHP is installed.

Heroku supports built-in PHP extensions, they can be enabled by adding them as a requirement in your composer file. To enable IMAP, add the requirement to your project's composer.json:

{
  "name": "vendor/project",
  "require": {
    "ext-imap": "*"
  }
}