PHP Class Swift_Transport_Esmtp_Auth_XOAuth2Authenticator, Halite

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
Author: xu.li ([email protected])
Inheritance: implements Swift_Transport_Esmtp_Authenticator
Afficher le fichier Open project: HaliteChallenge/Halite

Méthodes publiques

Méthode Description
authenticate ( Swift_Transport_SmtpAgent $agent, string $email, string $token ) : boolean Try to authenticate the user with $email and $token.
getAuthKeyword ( ) : string Get the name of the AUTH mechanism this Authenticator handles.

Méthodes protégées

Méthode Description
constructXOAuth2Params ( $email, $token ) Construct the auth parameter.

Method Details

authenticate() public méthode

Try to authenticate the user with $email and $token.
public authenticate ( Swift_Transport_SmtpAgent $agent, string $email, string $token ) : boolean
$agent Swift_Transport_SmtpAgent
$email string
$token string
Résultat boolean

constructXOAuth2Params() protected méthode

Construct the auth parameter.
See also: https://developers.google.com/google-apps/gmail/xoauth2_protocol#the_sasl_xoauth2_mechanism
protected constructXOAuth2Params ( $email, $token )

getAuthKeyword() public méthode

Get the name of the AUTH mechanism this Authenticator handles.
public getAuthKeyword ( ) : string
Résultat string