There seems to be a lot of white noise in trying to understand SMTP
that requires authentication when searching the newsgroups via Google
Groups or searching the PHP.net website. The PHP fsockopen API's notes
on php.net provide the routine to connect, unauthenticated, to send
messages. But if you need authentication, people want you to download
their class or check the PEAR. Some websites even want your email
address or some registration process to check out the file, but I
don't play that game. Anyway, these methods will work, but here's the
short of it...
After the HELO initial acknowledgement, do the following. (Translate
the pseudocode to PHP.)
1. Send "AUTH LOGIN\r\n"
2. Did you get message 334 back? If not, then server doesn't support
authentication. Break.
3. Send base64_encode($user)\r\n
4. Did you get message 334 back? If not, then server doesn't support
that username. Break.
5. Send base64_encode($pass)\r\n
6. Did you get 235 back? If not, then server doesn't support that
password. Break.
7. Proceed now with MAIL FROM, RCPT TO, DATA, etc.
Hope this helps you solve the problem faster.