Class Swift_Transport_Esmtp_Auth_XOAuth2Authenticator

InheritanceSwift_Transport_Esmtp_Auth_XOAuth2Authenticator
ImplementsSwift_Transport_Esmtp_Authenticator

Handles XOAUTH2 authentication.

Example: $transport = Swift_SmtpTransport::newInstance('smtp.gmail.com', 587, 'tls') ->setAuthMode('XOAUTH2') ->setUsername('YOUR_EMAIL_ADDRESS') ->setPassword('YOUR_ACCESS_TOKEN');

See also https://developers.google.com/google-apps/gmail/xoauth2_protocol.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
authenticate() Try to authenticate the user with $email and $token. Swift_Transport_Esmtp_Auth_XOAuth2Authenticator
getAuthKeyword() Get the name of the AUTH mechanism this Authenticator handles. Swift_Transport_Esmtp_Auth_XOAuth2Authenticator

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
constructXOAuth2Params() Construct the auth parameter. Swift_Transport_Esmtp_Auth_XOAuth2Authenticator

Method Details

authenticate() public method

Try to authenticate the user with $email and $token.

public bool authenticate ( Swift_Transport_SmtpAgent $agent, $email, $token )
$agent Swift_Transport_SmtpAgent
$email string
$token string
constructXOAuth2Params() protected method
protected void constructXOAuth2Params ( $email, $token )
$email
$token
getAuthKeyword() public method

Get the name of the AUTH mechanism this Authenticator handles.

public string getAuthKeyword ( )