Search code examples
phpimap

How to escape white space charachter in imap command line?


My problem is that I want to login to yahoo imap server using my user/pass.
The problem is that my password contains a space charachter, so how do I escape it, i used '^]' but it did not work, this is the code:

$user = "[email protected]";
$pass = "hey you!";

Command:

 mohsen LOGIN ".$user." ".$pass

it gives this error,
mohsen BAD [CLIENTBUG] Invalid command or arguments

Thank you,


Solution

  • Just wrap them in quotes:

    A LOGIN "[email protected]" "hey you!"

    You don't have a closing quote in your example.