Imap library works perfect for gmail but why php imap library do not work for reading Webmail inbox

178 Views Asked by At

hello guys hope you are doing well ! I am here with a problem related PHP Imap. I have done integration of Imap in Laravel. It reads my google mail like [email protected] successfully and works as aspected as i used gmail and created a secure app for password. Have a look on code

  $user='[email protected]';
    $host='imap.gmail.com';
    $port=993
    $flag='/imap/ssl/novalidate-cert'
    $pass='uqqepunhujjwtutm';
    $server = new Server($host,$port,$flag);
$connection = $server->authenticate($user, $pass);
    return $connection;

It works perfect. My problem is with reading webmail INBOX. when i change my credentials to read webmail

 $user='[email protected]';
        $host='mail.domain.com';
        $port=993
        $flag='/imap/ssl/novalidate-cert'
        $pass='myWebmailPassword';
        $server = new Server($host,$port,$flag);
    $connection = $server->authenticate($user, $pass);
        return $connection;

it shows me error.

Host not found

did i Skip any webmail side or cpanel side configuration. ?

Please guide me any help would be appreciated. thanks

0

There are 0 best solutions below