Documentation

Swift_Transport_Esmtp_Auth_XOAuth2Authenticator
in package
implements Swift_Transport_Esmtp_Authenticator

Handles XOAUTH2 authentication.

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

Tags
author

xu.li AthenaLightenedMyPath@gmail.com

see
https://developers.google.com/google-apps/gmail/xoauth2_protocol

Interfaces, Classes and Traits

Swift_Transport_Esmtp_Authenticator
An Authentication mechanism.

Table of Contents

authenticate()  : bool
Try to authenticate the user with $username and $password.
getAuthKeyword()  : string
Get the name of the AUTH mechanism this Authenticator handles.
constructXOAuth2Params()  : mixed
Construct the auth parameter.

Methods

authenticate()

Try to authenticate the user with $username and $password.

public authenticate(Swift_Transport_SmtpAgent $agent, mixed $email, mixed $token) : bool
Parameters
$agent : Swift_Transport_SmtpAgent
$email : mixed
$token : mixed
Return values
bool

true if authentication worked (returning false is deprecated, throw a Swift_TransportException instead)

getAuthKeyword()

Get the name of the AUTH mechanism this Authenticator handles.

public getAuthKeyword() : string
Return values
string

Search results