Question

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 = "example@yahoo.com";
$pass = "hey you!";

Command:

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

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

Thank you,

Était-ce utile?

La solution

Just wrap them in quotes:

A LOGIN "example@yahoo.com" "hey you!"

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

Autres conseils

Read RFC3501 and find out the syntax for passing strings around. Take a look at what options you have available (atom, quoted-string, literal) and what implications for escaping/formatting they bring.

Why don't you use some IMAP library given that you apparently do not know the pretty low-level building blocks which IMAP consists of?

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top