Share » Forums » Setup & design » SMTP Authentication

SMTP Authentication

SMTP Authentication

Monday 02 April 2007 2:25:24 pm - 1 reply

Modified on Monday 02 April 2007 2:26:24 pm by Guido Faecke

Author Message

Guido Faecke

Monday 02 April 2007 3:08:27 pm

so, i changed it a little bit more...

        function auth()
        {
            /* if the connection is made */
            /* changed from "AUTH" to "AUTH LOGIN" by G.Faecke */
            //if ( $this->send_cmd('AUTH', '334' ) )
            if ( $this->send_cmd('AUTH LOGIN', '334' ) )
            {
                /* if sending username ok */
                if ( $this->send_cmd( base64_encode( $this->user ), '334' ) )
                {
                    /* if sending password ok */
                    if ( $this->send_cmd( base64_encode( $this->pass ), '235' ) )
                    {
                        /* set the authenticated  flag and return TRUE */
                        $this->authenticated = TRUE;
                         return TRUE;
                    }
                }
            }
            /* added "AUTH PLAIN" by G.Faecke */
            if ( $this->send_cmd('AUTH PLAIN', '334' ) )
            {
                if ( $this->send_cmd( base64_encode( chr(0) . $this->user . chr(0) . $this->pass), '235' ) )
                {
                    /* set the authenticated  flag and return TRUE */
                    $this->authenticated = TRUE;
                    return TRUE;
                }
            }
            /* in other case return FALSE */
            return FALSE;
        }

I hope that's ok ;-)

Guido

my first ezPublish setup (test) ever with http://www.usa-info.net

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu