Net_SMTP::auth() – Attempt to do SMTP authentication.


require_once 'NET/SMTP.php';

mixedNet_SMTP::auth ( string $uid , string $pwd , string $method = '' )


This function initializes an authentication session using the supported methods. These are, in order of preference: Digest-MD5,CRAMMD5,LOGIN, and PLAIN.


string $uid

The userid to authenticate as.

string $pwd

The password to authenticate with.

string $method

The requested authentication method.If none is specified, the best supported method will be used.

boolean $tls

Flag indicating whether or not TLS should be attempted.

string $authz

An optional authorization identifier. If specified, this identifier will be used as the authorization proxy.

Return value

returns Returns a PEAR_Error with an error message on any kind of failure, or true on success.


throws no exceptions thrown


This function can not be called statically.

Instantiates a new Net_SMTP object, overriding any networkings with parameters that are passed in. (Previous) Attempt to connect to the SMTP server. (Next)
Last updated: Sat, 16 Feb 2019 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report.
View this page in:
  • English

User Notes:

There are no user contributed notes for this page.