Skip to content

Commit

Permalink
Remove trailing space, add line breaks for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
fbonzon committed Sep 15, 2015
1 parent dbf3fad commit b41b259
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
21 changes: 12 additions & 9 deletions class.phpmailer.php 100644 → 100755
Expand Up @@ -444,7 +444,7 @@ class PHPMailer
* @type string
*/
public $XMailer = '';

/**
* Only For XOAUTH - Google
* Options: An empty string for PHPMailer default, Enter the email used to get access token
Expand All @@ -454,8 +454,8 @@ class PHPMailer
// public $RefreshToken = '';
// public $ClientId = '';
// public $ClientSecret = '';


/**
* An instance of the SMTP sender class.
* @type SMTP
Expand Down Expand Up @@ -1384,7 +1384,7 @@ public function smtpConnect($options = array())
if (is_null($this->smtp)) {
$this->smtp = $this->getSMTPInstance();
}

// Already connected?
if ($this->smtp->connected()) {
return true;
Expand Down Expand Up @@ -1459,10 +1459,10 @@ public function smtpConnect($options = array())
}
if ($this->SMTPAuth) {
if (!$this->smtp->authenticate(
$this->Username,
$this->Password,
$this->AuthType,
$this->Realm,
$this->Username,
$this->Password,
$this->AuthType,
$this->Realm,
$this->Workstation
)
) {
Expand Down Expand Up @@ -3613,7 +3613,10 @@ public function DKIM_Add($headers_line, $subject, $body)
"\tbh=" . $DKIMb64 . ";\r\n" .
"\tb=";
$toSign = $this->DKIM_HeaderC(
$from_header . "\r\n" . $to_header . "\r\n" . $subject_header . "\r\n" . $dkimhdrs
$from_header . "\r\n" .
$to_header . "\r\n" .
$subject_header . "\r\n" .
$dkimhdrs
);
$signed = $this->DKIM_Sign($toSign);
return $dkimhdrs . $signed . "\r\n";
Expand Down
6 changes: 3 additions & 3 deletions class.phpmaileroauth.php 100644 → 100755
Expand Up @@ -55,7 +55,7 @@ class PHPMailerOAuth extends PHPMailer
* @access protected
*/
protected $oauth = null;

/**
* Get an OAuth instance to use.
* @return OAuth
Expand Down Expand Up @@ -87,11 +87,11 @@ public function smtpConnect($options = array())
if (is_null($this->smtp)) {
$this->smtp = $this->getSMTPInstance();
}

if (is_null($this->oauth)) {
$this->oauth = $this->getOAUTHInstance();
}

// Already connected?
if ($this->smtp->connected()) {
return true;
Expand Down
8 changes: 4 additions & 4 deletions class.phpmaileroauthgoogle.php 100644 → 100755
Expand Up @@ -30,7 +30,7 @@ class PHPMailerOAuthGoogle
private $oauthRefreshToken = '';
private $oauthClientId = '';
private $oauthClientSecret = '';

public function __construct(
$UserEmail,
$ClientSecret,
Expand All @@ -49,19 +49,19 @@ private function getProvider() {
'clientSecret' => $this->oauthClientSecret
]);
}

private function getGrant()
{
return new \League\OAuth2\Client\Grant\RefreshToken();
}

private function getToken()
{
$provider = $this->getProvider();
$grant = $this->getGrant();
return $provider->getAccessToken($grant, ['refresh_token' => $this->oauthRefreshToken]);
}

public function getOauth64()
{
$token = $this->getToken();
Expand Down

0 comments on commit b41b259

Please sign in to comment.