Gmail SMTP - Version 1.0.9

Version Description

  • Updated the PHPMailer library to the latest version (5.2.19). This release also contains a critical security update for CVE-2016-10033 that was fixed in PHPMailer 5.2.18.
Download this release

Release Info

Developer naa986
Plugin Icon 128x128 Gmail SMTP
Version 1.0.9
Comparing to
See all releases

Code changes from version 1.0.8 to 1.0.9

PHPMailer/class.phpmailer.php CHANGED
@@ -31,7 +31,7 @@ class PHPMailer
31
  * The PHPMailer Version number.
32
  * @var string
33
  */
34
- public $Version = '5.2.14';
35
 
36
  /**
37
  * Email priority.
@@ -201,6 +201,9 @@ class PHPMailer
201
  /**
202
  * An ID to be used in the Message-ID header.
203
  * If empty, a unique id will be generated.
 
 
 
204
  * @var string
205
  */
206
  public $MessageID = '';
@@ -285,7 +288,7 @@ class PHPMailer
285
 
286
  /**
287
  * SMTP auth type.
288
- * Options are LOGIN (default), PLAIN, NTLM, CRAM-MD5
289
  * @var string
290
  */
291
  public $AuthType = '';
@@ -352,6 +355,7 @@ class PHPMailer
352
  /**
353
  * Whether to split multiple to addresses into multiple messages
354
  * or send them all in one message.
 
355
  * @var boolean
356
  */
357
  public $SingleTo = false;
@@ -394,7 +398,7 @@ class PHPMailer
394
 
395
  /**
396
  * DKIM Identity.
397
- * Usually the email address used as the source of the email
398
  * @var string
399
  */
400
  public $DKIM_identity = '';
@@ -419,6 +423,13 @@ class PHPMailer
419
  */
420
  public $DKIM_private = '';
421
 
 
 
 
 
 
 
 
422
  /**
423
  * Callback Action function name.
424
  *
@@ -446,6 +457,15 @@ class PHPMailer
446
  */
447
  public $XMailer = '';
448
 
 
 
 
 
 
 
 
 
 
449
  /**
450
  * An instance of the SMTP sender class.
451
  * @var SMTP
@@ -634,9 +654,11 @@ class PHPMailer
634
  * Constructor.
635
  * @param boolean $exceptions Should we throw external exceptions?
636
  */
637
- public function __construct($exceptions = false)
638
  {
639
- $this->exceptions = (boolean)$exceptions;
 
 
640
  }
641
 
642
  /**
@@ -645,9 +667,7 @@ class PHPMailer
645
  public function __destruct()
646
  {
647
  //Close any open SMTP connection nicely
648
- if ($this->Mailer == 'smtp') {
649
- $this->smtpClose();
650
- }
651
  }
652
 
653
  /**
@@ -671,14 +691,16 @@ class PHPMailer
671
  } else {
672
  $subject = $this->encodeHeader($this->secureHeader($subject));
673
  }
674
- if (ini_get('safe_mode') || !($this->UseSendmailOptions)) {
 
 
 
675
  $result = @mail($to, $subject, $body, $header);
676
  } else {
677
  $result = @mail($to, $subject, $body, $header, $params);
678
  }
679
  return $result;
680
  }
681
-
682
  /**
683
  * Output debugging info via user-defined method.
684
  * Only generates output if SMTP debug output is enabled (@see SMTP::$do_debug).
@@ -713,7 +735,7 @@ class PHPMailer
713
  case 'echo':
714
  default:
715
  //Normalize line breaks
716
- $str = preg_replace('/(\r\n|\r|\n)/ms', "\n", $str);
717
  echo gmdate('Y-m-d H:i:s') . "\t" . str_replace(
718
  "\n",
719
  "\n \t ",
@@ -850,7 +872,7 @@ class PHPMailer
850
  $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
851
  if (($pos = strrpos($address, '@')) === false) {
852
  // At-sign is misssing.
853
- $error_message = $this->lang('invalid_address') . $address;
854
  $this->setError($error_message);
855
  $this->edebug($error_message);
856
  if ($this->exceptions) {
@@ -900,7 +922,7 @@ class PHPMailer
900
  return false;
901
  }
902
  if (!$this->validateAddress($address)) {
903
- $error_message = $this->lang('invalid_address') . $address;
904
  $this->setError($error_message);
905
  $this->edebug($error_message);
906
  if ($this->exceptions) {
@@ -994,7 +1016,7 @@ class PHPMailer
994
  if (($pos = strrpos($address, '@')) === false or
995
  (!$this->has8bitChars(substr($address, ++$pos)) or !$this->idnSupported()) and
996
  !$this->validateAddress($address)) {
997
- $error_message = $this->lang('invalid_address') . $address;
998
  $this->setError($error_message);
999
  $this->edebug($error_message);
1000
  if ($this->exceptions) {
@@ -1027,19 +1049,30 @@ class PHPMailer
1027
  /**
1028
  * Check that a string looks like an email address.
1029
  * @param string $address The email address to check
1030
- * @param string $patternselect A selector for the validation pattern to use :
1031
  * * `auto` Pick best pattern automatically;
1032
  * * `pcre8` Use the squiloople.com pattern, requires PCRE > 8.0, PHP >= 5.3.2, 5.2.14;
1033
  * * `pcre` Use old PCRE implementation;
1034
  * * `php` Use PHP built-in FILTER_VALIDATE_EMAIL;
1035
  * * `html5` Use the pattern given by the HTML5 spec for 'email' type form input elements.
1036
  * * `noregex` Don't use a regex: super fast, really dumb.
 
 
 
 
 
1037
  * @return boolean
1038
  * @static
1039
  * @access public
1040
  */
1041
- public static function validateAddress($address, $patternselect = 'auto')
1042
  {
 
 
 
 
 
 
1043
  //Reject line breaks in addresses; it's valid RFC5322, but not RFC5321
1044
  if (strpos($address, "\n") !== false or strpos($address, "\r") !== false) {
1045
  return false;
@@ -1216,7 +1249,7 @@ class PHPMailer
1216
  }
1217
  $this->$address_kind = $this->punyencodeAddress($this->$address_kind);
1218
  if (!$this->validateAddress($this->$address_kind)) {
1219
- $error_message = $this->lang('invalid_address') . $this->$address_kind;
1220
  $this->setError($error_message);
1221
  $this->edebug($error_message);
1222
  if ($this->exceptions) {
@@ -1227,7 +1260,7 @@ class PHPMailer
1227
  }
1228
 
1229
  // Set whether the message is multipart/alternative
1230
- if (!empty($this->AltBody)) {
1231
  $this->ContentType = 'multipart/alternative';
1232
  }
1233
 
@@ -1261,9 +1294,11 @@ class PHPMailer
1261
 
1262
  // Sign with DKIM if enabled
1263
  if (!empty($this->DKIM_domain)
1264
- && !empty($this->DKIM_private)
1265
  && !empty($this->DKIM_selector)
1266
- && file_exists($this->DKIM_private)) {
 
 
 
1267
  $header_dkim = $this->DKIM_Add(
1268
  $this->MIMEHeader . $this->mailHeader,
1269
  $this->encodeHeader($this->secureHeader($this->Subject)),
@@ -1329,7 +1364,7 @@ class PHPMailer
1329
  */
1330
  protected function sendmailSend($header, $body)
1331
  {
1332
- if ($this->Sender != '') {
1333
  if ($this->Mailer == 'qmail') {
1334
  $sendmail = sprintf('%s -f%s', escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender));
1335
  } else {
@@ -1404,17 +1439,17 @@ class PHPMailer
1404
  }
1405
  $to = implode(', ', $toArr);
1406
 
1407
- if (empty($this->Sender)) {
1408
- $params = ' ';
1409
- } else {
1410
- $params = sprintf('-f%s', $this->Sender);
1411
  }
1412
- if ($this->Sender != '' and !ini_get('safe_mode')) {
1413
  $old_from = ini_get('sendmail_from');
1414
  ini_set('sendmail_from', $this->Sender);
1415
  }
1416
  $result = false;
1417
- if ($this->SingleTo && count($toArr) > 1) {
1418
  foreach ($toArr as $toAddr) {
1419
  $result = $this->mailPassthru($toAddr, $this->Subject, $body, $header, $params);
1420
  $this->doCallback($result, array($toAddr), $this->cc, $this->bcc, $this->Subject, $body, $this->From);
@@ -1463,10 +1498,10 @@ class PHPMailer
1463
  if (!$this->smtpConnect($this->SMTPOptions)) {
1464
  throw new phpmailerException($this->lang('smtp_connect_failed'), self::STOP_CRITICAL);
1465
  }
1466
- if ('' == $this->Sender) {
1467
- $smtp_from = $this->From;
1468
- } else {
1469
  $smtp_from = $this->Sender;
 
 
1470
  }
1471
  if (!$this->smtp->mail($smtp_from)) {
1472
  $this->setError($this->lang('from_failed') . $smtp_from . ' : ' . implode(',', $this->smtp->getError()));
@@ -1520,12 +1555,17 @@ class PHPMailer
1520
  * @throws phpmailerException
1521
  * @return boolean
1522
  */
1523
- public function smtpConnect($options = array())
1524
  {
1525
  if (is_null($this->smtp)) {
1526
  $this->smtp = $this->getSMTPInstance();
1527
  }
1528
 
 
 
 
 
 
1529
  // Already connected?
1530
  if ($this->smtp->connected()) {
1531
  return true;
@@ -1595,7 +1635,7 @@ class PHPMailer
1595
  if (!$this->smtp->startTLS()) {
1596
  throw new phpmailerException($this->lang('connect_host'));
1597
  }
1598
- // We must resend HELO after tls negotiation
1599
  $this->smtp->hello($hello);
1600
  }
1601
  if ($this->SMTPAuth) {
@@ -1634,7 +1674,7 @@ class PHPMailer
1634
  */
1635
  public function smtpClose()
1636
  {
1637
- if ($this->smtp !== null) {
1638
  if ($this->smtp->connected()) {
1639
  $this->smtp->quit();
1640
  $this->smtp->close();
@@ -1653,6 +1693,19 @@ class PHPMailer
1653
  */
1654
  public function setLanguage($langcode = 'en', $lang_path = '')
1655
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
1656
  // Define full set of translatable strings in English
1657
  $PHPMAILER_LANG = array(
1658
  'authenticate' => 'SMTP Error: Could not authenticate.',
@@ -1679,6 +1732,10 @@ class PHPMailer
1679
  // Calculate an absolute path so it can work if CWD is not here
1680
  $lang_path = dirname(__FILE__). DIRECTORY_SEPARATOR . 'language'. DIRECTORY_SEPARATOR;
1681
  }
 
 
 
 
1682
  $foundlang = true;
1683
  $lang_file = $lang_path . 'phpmailer.lang-' . $langcode . '.php';
1684
  // There is no English translation file
@@ -1972,7 +2029,9 @@ class PHPMailer
1972
  $result .= $this->headerLine('Subject', $this->encodeHeader($this->secureHeader($this->Subject)));
1973
  }
1974
 
1975
- if ($this->MessageID != '') {
 
 
1976
  $this->lastMessageID = $this->MessageID;
1977
  } else {
1978
  $this->lastMessageID = sprintf('<%s@%s>', $this->uniqueid, $this->serverHostname());
@@ -2074,7 +2133,15 @@ class PHPMailer
2074
  */
2075
  public function getSentMIMEMessage()
2076
  {
2077
- return $this->MIMEHeader . $this->mailHeader . self::CRLF . $this->MIMEBody;
 
 
 
 
 
 
 
 
2078
  }
2079
 
2080
  /**
@@ -2088,7 +2155,7 @@ class PHPMailer
2088
  {
2089
  $body = '';
2090
  //Create unique IDs and preset boundaries
2091
- $this->uniqueid = md5(uniqid(time()));
2092
  $this->boundary[1] = 'b1_' . $this->uniqueid;
2093
  $this->boundary[2] = 'b2_' . $this->uniqueid;
2094
  $this->boundary[3] = 'b3_' . $this->uniqueid;
@@ -2104,12 +2171,12 @@ class PHPMailer
2104
  //Can we do a 7-bit downgrade?
2105
  if ($bodyEncoding == '8bit' and !$this->has8bitChars($this->Body)) {
2106
  $bodyEncoding = '7bit';
 
2107
  $bodyCharSet = 'us-ascii';
2108
  }
2109
  //If lines are too long, and we're not already using an encoding that will shorten them,
2110
- //change to quoted-printable transfer encoding
2111
  if ('base64' != $this->Encoding and self::hasLineLongerThanMax($this->Body)) {
2112
- $this->Encoding = 'quoted-printable';
2113
  $bodyEncoding = 'quoted-printable';
2114
  }
2115
 
@@ -2118,10 +2185,12 @@ class PHPMailer
2118
  //Can we do a 7-bit downgrade?
2119
  if ($altBodyEncoding == '8bit' and !$this->has8bitChars($this->AltBody)) {
2120
  $altBodyEncoding = '7bit';
 
2121
  $altBodyCharSet = 'us-ascii';
2122
  }
2123
- //If lines are too long, change to quoted-printable transfer encoding
2124
- if (self::hasLineLongerThanMax($this->AltBody)) {
 
2125
  $altBodyEncoding = 'quoted-printable';
2126
  }
2127
  //Use this as a preamble in all multipart message types
@@ -2224,8 +2293,10 @@ class PHPMailer
2224
  $body .= $this->attachAll('attachment', $this->boundary[1]);
2225
  break;
2226
  default:
2227
- // catch case 'plain' and case ''
2228
- $body .= $this->encodeString($this->Body, $bodyEncoding);
 
 
2229
  break;
2230
  }
2231
 
@@ -2331,8 +2402,7 @@ class PHPMailer
2331
 
2332
  /**
2333
  * Set the message type.
2334
- * PHPMailer only supports some preset message types,
2335
- * not arbitrary MIME structures.
2336
  * @access protected
2337
  * @return void
2338
  */
@@ -2350,6 +2420,7 @@ class PHPMailer
2350
  }
2351
  $this->message_type = implode('_', $type);
2352
  if ($this->message_type == '') {
 
2353
  $this->message_type = 'plain';
2354
  }
2355
  }
@@ -3264,16 +3335,18 @@ class PHPMailer
3264
  }
3265
 
3266
  /**
3267
- * Create a message from an HTML string.
3268
- * Automatically makes modifications for inline images and backgrounds
3269
- * and creates a plain-text version by converting the HTML.
3270
- * Overwrites any existing values in $this->Body and $this->AltBody
 
 
3271
  * @access public
3272
  * @param string $message HTML message string
3273
- * @param string $basedir baseline directory for path
3274
  * @param boolean|callable $advanced Whether to use the internal HTML to text converter
3275
  * or your own custom converter @see PHPMailer::html2text()
3276
- * @return string $message
3277
  */
3278
  public function msgHTML($message, $basedir = '', $advanced = false)
3279
  {
@@ -3296,7 +3369,7 @@ class PHPMailer
3296
  $message
3297
  );
3298
  }
3299
- } elseif (substr($url, 0, 4) !== 'cid:' && !preg_match('#^[A-z]+://#', $url)) {
3300
  // Do not change urls for absolute images (thanks to corvuscorax)
3301
  // Do not change urls that are already inline images
3302
  $filename = basename($url);
@@ -3332,7 +3405,7 @@ class PHPMailer
3332
  // Convert all message body line breaks to CRLF, makes quoted-printable encoding work much better
3333
  $this->Body = $this->normalizeBreaks($message);
3334
  $this->AltBody = $this->normalizeBreaks($this->html2text($message, $advanced));
3335
- if (empty($this->AltBody)) {
3336
  $this->AltBody = 'To view this email message, open it in a program that understands HTML!' .
3337
  self::CRLF . self::CRLF;
3338
  }
@@ -3343,7 +3416,7 @@ class PHPMailer
3343
  * Convert an HTML string into plain text.
3344
  * This is used by msgHTML().
3345
  * Note - older versions of this function used a bundled advanced converter
3346
- * which was been removed for license reasons in #232
3347
  * Example usage:
3348
  * <code>
3349
  * // Use default conversion
@@ -3643,7 +3716,7 @@ class PHPMailer
3643
  * @access public
3644
  * @param string $signHeader
3645
  * @throws phpmailerException
3646
- * @return string
3647
  */
3648
  public function DKIM_Sign($signHeader)
3649
  {
@@ -3653,15 +3726,35 @@ class PHPMailer
3653
  }
3654
  return '';
3655
  }
3656
- $privKeyStr = file_get_contents($this->DKIM_private);
3657
- if ($this->DKIM_passphrase != '') {
3658
  $privKey = openssl_pkey_get_private($privKeyStr, $this->DKIM_passphrase);
3659
  } else {
3660
- $privKey = $privKeyStr;
3661
  }
3662
- if (openssl_sign($signHeader, $signature, $privKey)) {
3663
- return base64_encode($signature);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3664
  }
 
3665
  return '';
3666
  }
3667
 
@@ -3678,7 +3771,7 @@ class PHPMailer
3678
  foreach ($lines as $key => $line) {
3679
  list($heading, $value) = explode(':', $line, 2);
3680
  $heading = strtolower($heading);
3681
- $value = preg_replace('/\s+/', ' ', $value); // Compress useless spaces
3682
  $lines[$key] = $heading . ':' . trim($value); // Don't forget to remove WSP around the value
3683
  }
3684
  $signHeader = implode("\r\n", $lines);
@@ -3716,7 +3809,7 @@ class PHPMailer
3716
  */
3717
  public function DKIM_Add($headers_line, $subject, $body)
3718
  {
3719
- $DKIMsignatureType = 'rsa-sha1'; // Signature & hash algorithms
3720
  $DKIMcanonicalization = 'relaxed/simple'; // Canonicalization of header/body
3721
  $DKIMquery = 'dns/txt'; // Query method
3722
  $DKIMtime = time(); // Signature Timestamp = seconds since 00:00:00 - Jan 1, 1970 (UTC time zone)
@@ -3724,6 +3817,7 @@ class PHPMailer
3724
  $headers = explode($this->LE, $headers_line);
3725
  $from_header = '';
3726
  $to_header = '';
 
3727
  $current = '';
3728
  foreach ($headers as $header) {
3729
  if (strpos($header, 'From:') === 0) {
@@ -3732,6 +3826,9 @@ class PHPMailer
3732
  } elseif (strpos($header, 'To:') === 0) {
3733
  $to_header = $header;
3734
  $current = 'to_header';
 
 
 
3735
  } else {
3736
  if (!empty($$current) && strpos($header, ' =?') === 0) {
3737
  $$current .= $header;
@@ -3742,6 +3839,7 @@ class PHPMailer
3742
  }
3743
  $from = str_replace('|', '=7C', $this->DKIM_QP($from_header));
3744
  $to = str_replace('|', '=7C', $this->DKIM_QP($to_header));
 
3745
  $subject = str_replace(
3746
  '|',
3747
  '=7C',
@@ -3749,7 +3847,7 @@ class PHPMailer
3749
  ); // Copied header fields (dkim-quoted-printable)
3750
  $body = $this->DKIM_BodyC($body);
3751
  $DKIMlen = strlen($body); // Length of body
3752
- $DKIMb64 = base64_encode(pack('H*', sha1($body))); // Base64 of packed binary SHA-1 hash of body
3753
  if ('' == $this->DKIM_identity) {
3754
  $ident = '';
3755
  } else {
@@ -3762,16 +3860,18 @@ class PHPMailer
3762
  $this->DKIM_selector .
3763
  ";\r\n" .
3764
  "\tt=" . $DKIMtime . '; c=' . $DKIMcanonicalization . ";\r\n" .
3765
- "\th=From:To:Subject;\r\n" .
3766
  "\td=" . $this->DKIM_domain . ';' . $ident . "\r\n" .
3767
  "\tz=$from\r\n" .
3768
  "\t|$to\r\n" .
 
3769
  "\t|$subject;\r\n" .
3770
  "\tbh=" . $DKIMb64 . ";\r\n" .
3771
  "\tb=";
3772
  $toSign = $this->DKIM_HeaderC(
3773
  $from_header . "\r\n" .
3774
  $to_header . "\r\n" .
 
3775
  $subject_header . "\r\n" .
3776
  $dkimhdrs
3777
  );
31
  * The PHPMailer Version number.
32
  * @var string
33
  */
34
+ public $Version = '5.2.19';
35
 
36
  /**
37
  * Email priority.
201
  /**
202
  * An ID to be used in the Message-ID header.
203
  * If empty, a unique id will be generated.
204
+ * You can set your own, but it must be in the format "<id@domain>",
205
+ * as defined in RFC5322 section 3.6.4 or it will be ignored.
206
+ * @see https://tools.ietf.org/html/rfc5322#section-3.6.4
207
  * @var string
208
  */
209
  public $MessageID = '';
288
 
289
  /**
290
  * SMTP auth type.
291
+ * Options are CRAM-MD5, LOGIN, PLAIN, NTLM, XOAUTH2, attempted in that order if not specified
292
  * @var string
293
  */
294
  public $AuthType = '';
355
  /**
356
  * Whether to split multiple to addresses into multiple messages
357
  * or send them all in one message.
358
+ * Only supported in `mail` and `sendmail` transports, not in SMTP.
359
  * @var boolean
360
  */
361
  public $SingleTo = false;
398
 
399
  /**
400
  * DKIM Identity.
401
+ * Usually the email address used as the source of the email.
402
  * @var string
403
  */
404
  public $DKIM_identity = '';
423
  */
424
  public $DKIM_private = '';
425
 
426
+ /**
427
+ * DKIM private key string.
428
+ * If set, takes precedence over `$DKIM_private`.
429
+ * @var string
430
+ */
431
+ public $DKIM_private_string = '';
432
+
433
  /**
434
  * Callback Action function name.
435
  *
457
  */
458
  public $XMailer = '';
459
 
460
+ /**
461
+ * Which validator to use by default when validating email addresses.
462
+ * May be a callable to inject your own validator, but there are several built-in validators.
463
+ * @see PHPMailer::validateAddress()
464
+ * @var string|callable
465
+ * @static
466
+ */
467
+ public static $validator = 'auto';
468
+
469
  /**
470
  * An instance of the SMTP sender class.
471
  * @var SMTP
654
  * Constructor.
655
  * @param boolean $exceptions Should we throw external exceptions?
656
  */
657
+ public function __construct($exceptions = null)
658
  {
659
+ if ($exceptions !== null) {
660
+ $this->exceptions = (boolean)$exceptions;
661
+ }
662
  }
663
 
664
  /**
667
  public function __destruct()
668
  {
669
  //Close any open SMTP connection nicely
670
+ $this->smtpClose();
 
 
671
  }
672
 
673
  /**
691
  } else {
692
  $subject = $this->encodeHeader($this->secureHeader($subject));
693
  }
694
+
695
+ //Can't use additional_parameters in safe_mode, calling mail() with null params breaks
696
+ //@link http://php.net/manual/en/function.mail.php
697
+ if (ini_get('safe_mode') or !$this->UseSendmailOptions or is_null($params)) {
698
  $result = @mail($to, $subject, $body, $header);
699
  } else {
700
  $result = @mail($to, $subject, $body, $header, $params);
701
  }
702
  return $result;
703
  }
 
704
  /**
705
  * Output debugging info via user-defined method.
706
  * Only generates output if SMTP debug output is enabled (@see SMTP::$do_debug).
735
  case 'echo':
736
  default:
737
  //Normalize line breaks
738
+ $str = preg_replace('/\r\n?/ms', "\n", $str);
739
  echo gmdate('Y-m-d H:i:s') . "\t" . str_replace(
740
  "\n",
741
  "\n \t ",
872
  $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
873
  if (($pos = strrpos($address, '@')) === false) {
874
  // At-sign is misssing.
875
+ $error_message = $this->lang('invalid_address') . " (addAnAddress $kind): $address";
876
  $this->setError($error_message);
877
  $this->edebug($error_message);
878
  if ($this->exceptions) {
922
  return false;
923
  }
924
  if (!$this->validateAddress($address)) {
925
+ $error_message = $this->lang('invalid_address') . " (addAnAddress $kind): $address";
926
  $this->setError($error_message);
927
  $this->edebug($error_message);
928
  if ($this->exceptions) {
1016
  if (($pos = strrpos($address, '@')) === false or
1017
  (!$this->has8bitChars(substr($address, ++$pos)) or !$this->idnSupported()) and
1018
  !$this->validateAddress($address)) {
1019
+ $error_message = $this->lang('invalid_address') . " (setFrom) $address";
1020
  $this->setError($error_message);
1021
  $this->edebug($error_message);
1022
  if ($this->exceptions) {
1049
  /**
1050
  * Check that a string looks like an email address.
1051
  * @param string $address The email address to check
1052
+ * @param string|callable $patternselect A selector for the validation pattern to use :
1053
  * * `auto` Pick best pattern automatically;
1054
  * * `pcre8` Use the squiloople.com pattern, requires PCRE > 8.0, PHP >= 5.3.2, 5.2.14;
1055
  * * `pcre` Use old PCRE implementation;
1056
  * * `php` Use PHP built-in FILTER_VALIDATE_EMAIL;
1057
  * * `html5` Use the pattern given by the HTML5 spec for 'email' type form input elements.
1058
  * * `noregex` Don't use a regex: super fast, really dumb.
1059
+ * Alternatively you may pass in a callable to inject your own validator, for example:
1060
+ * PHPMailer::validateAddress('user@example.com', function($address) {
1061
+ * return (strpos($address, '@') !== false);
1062
+ * });
1063
+ * You can also set the PHPMailer::$validator static to a callable, allowing built-in methods to use your validator.
1064
  * @return boolean
1065
  * @static
1066
  * @access public
1067
  */
1068
+ public static function validateAddress($address, $patternselect = null)
1069
  {
1070
+ if (is_null($patternselect)) {
1071
+ $patternselect = self::$validator;
1072
+ }
1073
+ if (is_callable($patternselect)) {
1074
+ return call_user_func($patternselect, $address);
1075
+ }
1076
  //Reject line breaks in addresses; it's valid RFC5322, but not RFC5321
1077
  if (strpos($address, "\n") !== false or strpos($address, "\r") !== false) {
1078
  return false;
1249
  }
1250
  $this->$address_kind = $this->punyencodeAddress($this->$address_kind);
1251
  if (!$this->validateAddress($this->$address_kind)) {
1252
+ $error_message = $this->lang('invalid_address') . ' (punyEncode) ' . $this->$address_kind;
1253
  $this->setError($error_message);
1254
  $this->edebug($error_message);
1255
  if ($this->exceptions) {
1260
  }
1261
 
1262
  // Set whether the message is multipart/alternative
1263
+ if ($this->alternativeExists()) {
1264
  $this->ContentType = 'multipart/alternative';
1265
  }
1266
 
1294
 
1295
  // Sign with DKIM if enabled
1296
  if (!empty($this->DKIM_domain)
 
1297
  && !empty($this->DKIM_selector)
1298
+ && (!empty($this->DKIM_private_string)
1299
+ || (!empty($this->DKIM_private) && file_exists($this->DKIM_private))
1300
+ )
1301
+ ) {
1302
  $header_dkim = $this->DKIM_Add(
1303
  $this->MIMEHeader . $this->mailHeader,
1304
  $this->encodeHeader($this->secureHeader($this->Subject)),
1364
  */
1365
  protected function sendmailSend($header, $body)
1366
  {
1367
+ if (!empty($this->Sender)) {
1368
  if ($this->Mailer == 'qmail') {
1369
  $sendmail = sprintf('%s -f%s', escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender));
1370
  } else {
1439
  }
1440
  $to = implode(', ', $toArr);
1441
 
1442
+ $params = null;
1443
+ //This sets the SMTP envelope sender which gets turned into a return-path header by the receiver
1444
+ if (!empty($this->Sender) and $this->validateAddress($this->Sender)) {
1445
+ $params = sprintf('-f%s', escapeshellarg($this->Sender));
1446
  }
1447
+ if (!empty($this->Sender) and !ini_get('safe_mode') and $this->validateAddress($this->Sender)) {
1448
  $old_from = ini_get('sendmail_from');
1449
  ini_set('sendmail_from', $this->Sender);
1450
  }
1451
  $result = false;
1452
+ if ($this->SingleTo and count($toArr) > 1) {
1453
  foreach ($toArr as $toAddr) {
1454
  $result = $this->mailPassthru($toAddr, $this->Subject, $body, $header, $params);
1455
  $this->doCallback($result, array($toAddr), $this->cc, $this->bcc, $this->Subject, $body, $this->From);
1498
  if (!$this->smtpConnect($this->SMTPOptions)) {
1499
  throw new phpmailerException($this->lang('smtp_connect_failed'), self::STOP_CRITICAL);
1500
  }
1501
+ if (!empty($this->Sender) and $this->validateAddress($this->Sender)) {
 
 
1502
  $smtp_from = $this->Sender;
1503
+ } else {
1504
+ $smtp_from = $this->From;
1505
  }
1506
  if (!$this->smtp->mail($smtp_from)) {
1507
  $this->setError($this->lang('from_failed') . $smtp_from . ' : ' . implode(',', $this->smtp->getError()));
1555
  * @throws phpmailerException
1556
  * @return boolean
1557
  */
1558
+ public function smtpConnect($options = null)
1559
  {
1560
  if (is_null($this->smtp)) {
1561
  $this->smtp = $this->getSMTPInstance();
1562
  }
1563
 
1564
+ //If no options are provided, use whatever is set in the instance
1565
+ if (is_null($options)) {
1566
+ $options = $this->SMTPOptions;
1567
+ }
1568
+
1569
  // Already connected?
1570
  if ($this->smtp->connected()) {
1571
  return true;
1635
  if (!$this->smtp->startTLS()) {
1636
  throw new phpmailerException($this->lang('connect_host'));
1637
  }
1638
+ // We must resend EHLO after TLS negotiation
1639
  $this->smtp->hello($hello);
1640
  }
1641
  if ($this->SMTPAuth) {
1674
  */
1675
  public function smtpClose()
1676
  {
1677
+ if (is_a($this->smtp, 'SMTP')) {
1678
  if ($this->smtp->connected()) {
1679
  $this->smtp->quit();
1680
  $this->smtp->close();
1693
  */
1694
  public function setLanguage($langcode = 'en', $lang_path = '')
1695
  {
1696
+ // Backwards compatibility for renamed language codes
1697
+ $renamed_langcodes = array(
1698
+ 'br' => 'pt_br',
1699
+ 'cz' => 'cs',
1700
+ 'dk' => 'da',
1701
+ 'no' => 'nb',
1702
+ 'se' => 'sv',
1703
+ );
1704
+
1705
+ if (isset($renamed_langcodes[$langcode])) {
1706
+ $langcode = $renamed_langcodes[$langcode];
1707
+ }
1708
+
1709
  // Define full set of translatable strings in English
1710
  $PHPMAILER_LANG = array(
1711
  'authenticate' => 'SMTP Error: Could not authenticate.',
1732
  // Calculate an absolute path so it can work if CWD is not here
1733
  $lang_path = dirname(__FILE__). DIRECTORY_SEPARATOR . 'language'. DIRECTORY_SEPARATOR;
1734
  }
1735
+ //Validate $langcode
1736
+ if (!preg_match('/^[a-z]{2}(?:_[a-zA-Z]{2})?$/', $langcode)) {
1737
+ $langcode = 'en';
1738
+ }
1739
  $foundlang = true;
1740
  $lang_file = $lang_path . 'phpmailer.lang-' . $langcode . '.php';
1741
  // There is no English translation file
2029
  $result .= $this->headerLine('Subject', $this->encodeHeader($this->secureHeader($this->Subject)));
2030
  }
2031
 
2032
+ // Only allow a custom message ID if it conforms to RFC 5322 section 3.6.4
2033
+ // https://tools.ietf.org/html/rfc5322#section-3.6.4
2034
+ if ('' != $this->MessageID and preg_match('/^<.*@.*>$/', $this->MessageID)) {
2035
  $this->lastMessageID = $this->MessageID;
2036
  } else {
2037
  $this->lastMessageID = sprintf('<%s@%s>', $this->uniqueid, $this->serverHostname());
2133
  */
2134
  public function getSentMIMEMessage()
2135
  {
2136
+ return rtrim($this->MIMEHeader . $this->mailHeader, "\n\r") . self::CRLF . self::CRLF . $this->MIMEBody;
2137
+ }
2138
+
2139
+ /**
2140
+ * Create unique ID
2141
+ * @return string
2142
+ */
2143
+ protected function generateId() {
2144
+ return md5(uniqid(time()));
2145
  }
2146
 
2147
  /**
2155
  {
2156
  $body = '';
2157
  //Create unique IDs and preset boundaries
2158
+ $this->uniqueid = $this->generateId();
2159
  $this->boundary[1] = 'b1_' . $this->uniqueid;
2160
  $this->boundary[2] = 'b2_' . $this->uniqueid;
2161
  $this->boundary[3] = 'b3_' . $this->uniqueid;
2171
  //Can we do a 7-bit downgrade?
2172
  if ($bodyEncoding == '8bit' and !$this->has8bitChars($this->Body)) {
2173
  $bodyEncoding = '7bit';
2174
+ //All ISO 8859, Windows codepage and UTF-8 charsets are ascii compatible up to 7-bit
2175
  $bodyCharSet = 'us-ascii';
2176
  }
2177
  //If lines are too long, and we're not already using an encoding that will shorten them,
2178
+ //change to quoted-printable transfer encoding for the body part only
2179
  if ('base64' != $this->Encoding and self::hasLineLongerThanMax($this->Body)) {
 
2180
  $bodyEncoding = 'quoted-printable';
2181
  }
2182
 
2185
  //Can we do a 7-bit downgrade?
2186
  if ($altBodyEncoding == '8bit' and !$this->has8bitChars($this->AltBody)) {
2187
  $altBodyEncoding = '7bit';
2188
+ //All ISO 8859, Windows codepage and UTF-8 charsets are ascii compatible up to 7-bit
2189
  $altBodyCharSet = 'us-ascii';
2190
  }
2191
+ //If lines are too long, and we're not already using an encoding that will shorten them,
2192
+ //change to quoted-printable transfer encoding for the alt body part only
2193
+ if ('base64' != $altBodyEncoding and self::hasLineLongerThanMax($this->AltBody)) {
2194
  $altBodyEncoding = 'quoted-printable';
2195
  }
2196
  //Use this as a preamble in all multipart message types
2293
  $body .= $this->attachAll('attachment', $this->boundary[1]);
2294
  break;
2295
  default:
2296
+ // Catch case 'plain' and case '', applies to simple `text/plain` and `text/html` body content types
2297
+ //Reset the `Encoding` property in case we changed it for line length reasons
2298
+ $this->Encoding = $bodyEncoding;
2299
+ $body .= $this->encodeString($this->Body, $this->Encoding);
2300
  break;
2301
  }
2302
 
2402
 
2403
  /**
2404
  * Set the message type.
2405
+ * PHPMailer only supports some preset message types, not arbitrary MIME structures.
 
2406
  * @access protected
2407
  * @return void
2408
  */
2420
  }
2421
  $this->message_type = implode('_', $type);
2422
  if ($this->message_type == '') {
2423
+ //The 'plain' message_type refers to the message having a single body element, not that it is plain-text
2424
  $this->message_type = 'plain';
2425
  }
2426
  }
3335
  }
3336
 
3337
  /**
3338
+ * Create a message body from an HTML string.
3339
+ * Automatically inlines images and creates a plain-text version by converting the HTML,
3340
+ * overwriting any existing values in Body and AltBody.
3341
+ * $basedir is used when handling relative image paths, e.g. <img src="images/a.png">
3342
+ * will look for an image file in $basedir/images/a.png and convert it to inline.
3343
+ * If you don't want to apply these transformations to your HTML, just set Body and AltBody yourself.
3344
  * @access public
3345
  * @param string $message HTML message string
3346
+ * @param string $basedir base directory for relative paths to images
3347
  * @param boolean|callable $advanced Whether to use the internal HTML to text converter
3348
  * or your own custom converter @see PHPMailer::html2text()
3349
+ * @return string $message The transformed message Body
3350
  */
3351
  public function msgHTML($message, $basedir = '', $advanced = false)
3352
  {
3369
  $message
3370
  );
3371
  }
3372
+ } elseif (substr($url, 0, 4) !== 'cid:' && !preg_match('#^[a-z][a-z0-9+.-]*://#i', $url)) {
3373
  // Do not change urls for absolute images (thanks to corvuscorax)
3374
  // Do not change urls that are already inline images
3375
  $filename = basename($url);
3405
  // Convert all message body line breaks to CRLF, makes quoted-printable encoding work much better
3406
  $this->Body = $this->normalizeBreaks($message);
3407
  $this->AltBody = $this->normalizeBreaks($this->html2text($message, $advanced));
3408
+ if (!$this->alternativeExists()) {
3409
  $this->AltBody = 'To view this email message, open it in a program that understands HTML!' .
3410
  self::CRLF . self::CRLF;
3411
  }
3416
  * Convert an HTML string into plain text.
3417
  * This is used by msgHTML().
3418
  * Note - older versions of this function used a bundled advanced converter
3419
+ * which was been removed for license reasons in #232.
3420
  * Example usage:
3421
  * <code>
3422
  * // Use default conversion
3716
  * @access public
3717
  * @param string $signHeader
3718
  * @throws phpmailerException
3719
+ * @return string The DKIM signature value
3720
  */
3721
  public function DKIM_Sign($signHeader)
3722
  {
3726
  }
3727
  return '';
3728
  }
3729
+ $privKeyStr = !empty($this->DKIM_private_string) ? $this->DKIM_private_string : file_get_contents($this->DKIM_private);
3730
+ if ('' != $this->DKIM_passphrase) {
3731
  $privKey = openssl_pkey_get_private($privKeyStr, $this->DKIM_passphrase);
3732
  } else {
3733
+ $privKey = openssl_pkey_get_private($privKeyStr);
3734
  }
3735
+ //Workaround for missing digest algorithms in old PHP & OpenSSL versions
3736
+ //@link http://stackoverflow.com/a/11117338/333340
3737
+ if (version_compare(PHP_VERSION, '5.3.0') >= 0 and
3738
+ in_array('sha256WithRSAEncryption', openssl_get_md_methods(true))) {
3739
+ if (openssl_sign($signHeader, $signature, $privKey, 'sha256WithRSAEncryption')) {
3740
+ openssl_pkey_free($privKey);
3741
+ return base64_encode($signature);
3742
+ }
3743
+ } else {
3744
+ $pinfo = openssl_pkey_get_details($privKey);
3745
+ $hash = hash('sha256', $signHeader);
3746
+ //'Magic' constant for SHA256 from RFC3447
3747
+ //@link https://tools.ietf.org/html/rfc3447#page-43
3748
+ $t = '3031300d060960864801650304020105000420' . $hash;
3749
+ $pslen = $pinfo['bits'] / 8 - (strlen($t) / 2 + 3);
3750
+ $eb = pack('H*', '0001' . str_repeat('FF', $pslen) . '00' . $t);
3751
+
3752
+ if (openssl_private_encrypt($eb, $signature, $privKey, OPENSSL_NO_PADDING)) {
3753
+ openssl_pkey_free($privKey);
3754
+ return base64_encode($signature);
3755
+ }
3756
  }
3757
+ openssl_pkey_free($privKey);
3758
  return '';
3759
  }
3760
 
3771
  foreach ($lines as $key => $line) {
3772
  list($heading, $value) = explode(':', $line, 2);
3773
  $heading = strtolower($heading);
3774
+ $value = preg_replace('/\s{2,}/', ' ', $value); // Compress useless spaces
3775
  $lines[$key] = $heading . ':' . trim($value); // Don't forget to remove WSP around the value
3776
  }
3777
  $signHeader = implode("\r\n", $lines);
3809
  */
3810
  public function DKIM_Add($headers_line, $subject, $body)
3811
  {
3812
+ $DKIMsignatureType = 'rsa-sha256'; // Signature & hash algorithms
3813
  $DKIMcanonicalization = 'relaxed/simple'; // Canonicalization of header/body
3814
  $DKIMquery = 'dns/txt'; // Query method
3815
  $DKIMtime = time(); // Signature Timestamp = seconds since 00:00:00 - Jan 1, 1970 (UTC time zone)
3817
  $headers = explode($this->LE, $headers_line);
3818
  $from_header = '';
3819
  $to_header = '';
3820
+ $date_header = '';
3821
  $current = '';
3822
  foreach ($headers as $header) {
3823
  if (strpos($header, 'From:') === 0) {
3826
  } elseif (strpos($header, 'To:') === 0) {
3827
  $to_header = $header;
3828
  $current = 'to_header';
3829
+ } elseif (strpos($header, 'Date:') === 0) {
3830
+ $date_header = $header;
3831
+ $current = 'date_header';
3832
  } else {
3833
  if (!empty($$current) && strpos($header, ' =?') === 0) {
3834
  $$current .= $header;
3839
  }
3840
  $from = str_replace('|', '=7C', $this->DKIM_QP($from_header));
3841
  $to = str_replace('|', '=7C', $this->DKIM_QP($to_header));
3842
+ $date = str_replace('|', '=7C', $this->DKIM_QP($date_header));
3843
  $subject = str_replace(
3844
  '|',
3845
  '=7C',
3847
  ); // Copied header fields (dkim-quoted-printable)
3848
  $body = $this->DKIM_BodyC($body);
3849
  $DKIMlen = strlen($body); // Length of body
3850
+ $DKIMb64 = base64_encode(pack('H*', hash('sha256', $body))); // Base64 of packed binary SHA-256 hash of body
3851
  if ('' == $this->DKIM_identity) {
3852
  $ident = '';
3853
  } else {
3860
  $this->DKIM_selector .
3861
  ";\r\n" .
3862
  "\tt=" . $DKIMtime . '; c=' . $DKIMcanonicalization . ";\r\n" .
3863
+ "\th=From:To:Date:Subject;\r\n" .
3864
  "\td=" . $this->DKIM_domain . ';' . $ident . "\r\n" .
3865
  "\tz=$from\r\n" .
3866
  "\t|$to\r\n" .
3867
+ "\t|$date\r\n" .
3868
  "\t|$subject;\r\n" .
3869
  "\tbh=" . $DKIMb64 . ";\r\n" .
3870
  "\tb=";
3871
  $toSign = $this->DKIM_HeaderC(
3872
  $from_header . "\r\n" .
3873
  $to_header . "\r\n" .
3874
+ $date_header . "\r\n" .
3875
  $subject_header . "\r\n" .
3876
  $dkimhdrs
3877
  );
PHPMailer/class.phpmaileroauth.php CHANGED
@@ -80,6 +80,7 @@ class PHPMailerOAuth extends PHPMailer
80
  * @uses SMTP
81
  * @access public
82
  * @return bool
 
83
  */
84
  public function smtpConnect($options = array())
85
  {
80
  * @uses SMTP
81
  * @access public
82
  * @return bool
83
+ * @throws phpmailerException
84
  */
85
  public function smtpConnect($options = array())
86
  {
PHPMailer/class.phpmaileroauthgoogle.php CHANGED
@@ -49,7 +49,8 @@ class PHPMailerOAuthGoogle
49
  $this->oauthUserEmail = $UserEmail;
50
  }
51
 
52
- private function getProvider() {
 
53
  return new League\OAuth2\Client\Provider\Google([
54
  'clientId' => $this->oauthClientId,
55
  'clientSecret' => $this->oauthClientSecret
49
  $this->oauthUserEmail = $UserEmail;
50
  }
51
 
52
+ private function getProvider()
53
+ {
54
  return new League\OAuth2\Client\Provider\Google([
55
  'clientId' => $this->oauthClientId,
56
  'clientSecret' => $this->oauthClientSecret
PHPMailer/class.pop3.php CHANGED
@@ -34,7 +34,7 @@ class POP3
34
  * @var string
35
  * @access public
36
  */
37
- public $Version = '5.2.14';
38
 
39
  /**
40
  * Default POP3 port number.
34
  * @var string
35
  * @access public
36
  */
37
+ public $Version = '5.2.19';
38
 
39
  /**
40
  * Default POP3 port number.
PHPMailer/class.smtp.php CHANGED
@@ -30,7 +30,7 @@ class SMTP
30
  * The PHPMailer SMTP version number.
31
  * @var string
32
  */
33
- const VERSION = '5.2.14';
34
 
35
  /**
36
  * SMTP line break constant.
@@ -81,7 +81,7 @@ class SMTP
81
  * @deprecated Use the `VERSION` constant instead
82
  * @see SMTP::VERSION
83
  */
84
- public $Version = '5.2.14';
85
 
86
  /**
87
  * SMTP server port number.
@@ -150,6 +150,17 @@ class SMTP
150
  */
151
  public $Timelimit = 300;
152
 
 
 
 
 
 
 
 
 
 
 
 
153
  /**
154
  * The socket for the server connection.
155
  * @var resource
@@ -206,7 +217,7 @@ class SMTP
206
  }
207
  //Avoid clash with built-in function names
208
  if (!in_array($this->Debugoutput, array('error_log', 'html', 'echo')) and is_callable($this->Debugoutput)) {
209
- call_user_func($this->Debugoutput, $str, $this->do_debug);
210
  return;
211
  }
212
  switch ($this->Debugoutput) {
@@ -272,8 +283,8 @@ class SMTP
272
  $errstr = '';
273
  if ($streamok) {
274
  $socket_context = stream_context_create($options);
275
- //Suppress errors; connection failures are handled at a higher level
276
- $this->smtp_conn = @stream_socket_client(
277
  $host . ":" . $port,
278
  $errno,
279
  $errstr,
@@ -281,12 +292,14 @@ class SMTP
281
  STREAM_CLIENT_CONNECT,
282
  $socket_context
283
  );
 
284
  } else {
285
  //Fall back to fsockopen which should work in more places, but is missing some features
286
  $this->edebug(
287
  "Connection: stream_socket_client not available, falling back to fsockopen",
288
  self::DEBUG_CONNECTION
289
  );
 
290
  $this->smtp_conn = fsockopen(
291
  $host,
292
  $port,
@@ -294,6 +307,7 @@ class SMTP
294
  $errstr,
295
  $timeout
296
  );
 
297
  }
298
  // Verify we connected properly
299
  if (!is_resource($this->smtp_conn)) {
@@ -336,11 +350,22 @@ class SMTP
336
  if (!$this->sendCommand('STARTTLS', 'STARTTLS', 220)) {
337
  return false;
338
  }
 
 
 
 
 
 
 
 
 
 
 
339
  // Begin encrypted connection
340
  if (!stream_socket_enable_crypto(
341
  $this->smtp_conn,
342
  true,
343
- STREAM_CRYPTO_METHOD_TLS_CLIENT
344
  )) {
345
  return false;
346
  }
@@ -389,7 +414,7 @@ class SMTP
389
  );
390
 
391
  if (empty($authtype)) {
392
- foreach (array('LOGIN', 'CRAM-MD5', 'NTLM', 'PLAIN', 'XOAUTH2') as $method) {
393
  if (in_array($method, $this->server_caps['AUTH'])) {
394
  $authtype = $method;
395
  break;
@@ -463,7 +488,7 @@ class SMTP
463
  $temp = new stdClass;
464
  $ntlm_client = new ntlm_sasl_client_class;
465
  //Check that functions are available
466
- if (!$ntlm_client->Initialize($temp)) {
467
  $this->setError($temp->error);
468
  $this->edebug(
469
  'You need to enable some modules in your php.ini file: '
@@ -473,7 +498,7 @@ class SMTP
473
  return false;
474
  }
475
  //msg1
476
- $msg1 = $ntlm_client->TypeMsg1($realm, $workstation); //msg1
477
 
478
  if (!$this->sendCommand(
479
  'AUTH NTLM',
@@ -492,7 +517,7 @@ class SMTP
492
  $password
493
  );
494
  //msg3
495
- $msg3 = $ntlm_client->TypeMsg3(
496
  $ntlm_res,
497
  $username,
498
  $realm,
@@ -736,7 +761,7 @@ class SMTP
736
  protected function parseHelloFields($type)
737
  {
738
  $this->server_caps = array();
739
- $lines = explode("\n", $this->last_reply);
740
 
741
  foreach ($lines as $n => $s) {
742
  //First 4 chars contain response code followed by - or space
@@ -1178,4 +1203,47 @@ class SMTP
1178
  {
1179
  return $this->Timeout;
1180
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1181
  }
30
  * The PHPMailer SMTP version number.
31
  * @var string
32
  */
33
+ const VERSION = '5.2.19';
34
 
35
  /**
36
  * SMTP line break constant.
81
  * @deprecated Use the `VERSION` constant instead
82
  * @see SMTP::VERSION
83
  */
84
+ public $Version = '5.2.19';
85
 
86
  /**
87
  * SMTP server port number.
150
  */
151
  public $Timelimit = 300;
152
 
153
+ /**
154
+ * @var array patterns to extract smtp transaction id from smtp reply
155
+ * Only first capture group will be use, use non-capturing group to deal with it
156
+ * Extend this class to override this property to fulfil your needs.
157
+ */
158
+ protected $smtp_transaction_id_patterns = array(
159
+ 'exim' => '/[0-9]{3} OK id=(.*)/',
160
+ 'sendmail' => '/[0-9]{3} 2.0.0 (.*) Message/',
161
+ 'postfix' => '/[0-9]{3} 2.0.0 Ok: queued as (.*)/'
162
+ );
163
+
164
  /**
165
  * The socket for the server connection.
166
  * @var resource
217
  }
218
  //Avoid clash with built-in function names
219
  if (!in_array($this->Debugoutput, array('error_log', 'html', 'echo')) and is_callable($this->Debugoutput)) {
220
+ call_user_func($this->Debugoutput, $str, $level);
221
  return;
222
  }
223
  switch ($this->Debugoutput) {
283
  $errstr = '';
284
  if ($streamok) {
285
  $socket_context = stream_context_create($options);
286
+ set_error_handler(array($this, 'errorHandler'));
287
+ $this->smtp_conn = stream_socket_client(
288
  $host . ":" . $port,
289
  $errno,
290
  $errstr,
292
  STREAM_CLIENT_CONNECT,
293
  $socket_context
294
  );
295
+ restore_error_handler();
296
  } else {
297
  //Fall back to fsockopen which should work in more places, but is missing some features
298
  $this->edebug(
299
  "Connection: stream_socket_client not available, falling back to fsockopen",
300
  self::DEBUG_CONNECTION
301
  );
302
+ set_error_handler(array($this, 'errorHandler'));
303
  $this->smtp_conn = fsockopen(
304
  $host,
305
  $port,
307
  $errstr,
308
  $timeout
309
  );
310
+ restore_error_handler();
311
  }
312
  // Verify we connected properly
313
  if (!is_resource($this->smtp_conn)) {
350
  if (!$this->sendCommand('STARTTLS', 'STARTTLS', 220)) {
351
  return false;
352
  }
353
+
354
+ //Allow the best TLS version(s) we can
355
+ $crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT;
356
+
357
+ //PHP 5.6.7 dropped inclusion of TLS 1.1 and 1.2 in STREAM_CRYPTO_METHOD_TLS_CLIENT
358
+ //so add them back in manually if we can
359
+ if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) {
360
+ $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
361
+ $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT;
362
+ }
363
+
364
  // Begin encrypted connection
365
  if (!stream_socket_enable_crypto(
366
  $this->smtp_conn,
367
  true,
368
+ $crypto_method
369
  )) {
370
  return false;
371
  }
414
  );
415
 
416
  if (empty($authtype)) {
417
+ foreach (array('CRAM-MD5', 'LOGIN', 'PLAIN', 'NTLM', 'XOAUTH2') as $method) {
418
  if (in_array($method, $this->server_caps['AUTH'])) {
419
  $authtype = $method;
420
  break;
488
  $temp = new stdClass;
489
  $ntlm_client = new ntlm_sasl_client_class;
490
  //Check that functions are available
491
+ if (!$ntlm_client->initialize($temp)) {
492
  $this->setError($temp->error);
493
  $this->edebug(
494
  'You need to enable some modules in your php.ini file: '
498
  return false;
499
  }
500
  //msg1
501
+ $msg1 = $ntlm_client->typeMsg1($realm, $workstation); //msg1
502
 
503
  if (!$this->sendCommand(
504
  'AUTH NTLM',
517
  $password
518
  );
519
  //msg3
520
+ $msg3 = $ntlm_client->typeMsg3(
521
  $ntlm_res,
522
  $username,
523
  $realm,
761
  protected function parseHelloFields($type)
762
  {
763
  $this->server_caps = array();
764
+ $lines = explode("\n", $this->helo_rply);
765
 
766
  foreach ($lines as $n => $s) {
767
  //First 4 chars contain response code followed by - or space
1203
  {
1204
  return $this->Timeout;
1205
  }
1206
+
1207
+ /**
1208
+ * Reports an error number and string.
1209
+ * @param integer $errno The error number returned by PHP.
1210
+ * @param string $errmsg The error message returned by PHP.
1211
+ */
1212
+ protected function errorHandler($errno, $errmsg)
1213
+ {
1214
+ $notice = 'Connection: Failed to connect to server.';
1215
+ $this->setError(
1216
+ $notice,
1217
+ $errno,
1218
+ $errmsg
1219
+ );
1220
+ $this->edebug(
1221
+ $notice . ' Error number ' . $errno . '. "Error notice: ' . $errmsg,
1222
+ self::DEBUG_CONNECTION
1223
+ );
1224
+ }
1225
+
1226
+ /**
1227
+ * Will return the ID of the last smtp transaction based on a list of patterns provided
1228
+ * in SMTP::$smtp_transaction_id_patterns.
1229
+ * If no reply has been received yet, it will return null.
1230
+ * If no pattern has been matched, it will return false.
1231
+ * @return bool|null|string
1232
+ */
1233
+ public function getLastTransactionID()
1234
+ {
1235
+ $reply = $this->getLastReply();
1236
+
1237
+ if (empty($reply)) {
1238
+ return null;
1239
+ }
1240
+
1241
+ foreach($this->smtp_transaction_id_patterns as $smtp_transaction_id_pattern) {
1242
+ if(preg_match($smtp_transaction_id_pattern, $reply, $matches)) {
1243
+ return $matches[1];
1244
+ }
1245
+ }
1246
+
1247
+ return false;
1248
+ }
1249
  }
PHPMailer/get_oauth_token.php CHANGED
@@ -13,8 +13,15 @@
13
  * PHP Version 5.4
14
  */
15
 
 
 
16
  require 'vendor/autoload.php';
17
 
 
 
 
 
 
18
  session_start();
19
 
20
  //If this automatic URL doesn't work, set it yourself manually
@@ -25,14 +32,109 @@ $redirectUri = isset($_SERVER['HTTPS']) ? 'https://' : 'http://' . $_SERVER['HTT
25
  $clientId = 'RANDOMCHARS-----duv1n2.apps.googleusercontent.com';
26
  $clientSecret = 'RANDOMCHARS-----lGyjPcRtvP';
27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  //Set Redirect URI in Developer Console as [https/http]://<yourdomain>/<folder>/get_oauth_token.php
29
- $provider = new League\OAuth2\Client\Provider\Google(
30
  array(
31
  'clientId' => $clientId,
32
  'clientSecret' => $clientSecret,
33
  'redirectUri' => $redirectUri,
34
- 'scopes' => array('https://mail.google.com/'),
35
- 'accessType' => 'offline'
36
  )
37
  );
38
 
13
  * PHP Version 5.4
14
  */
15
 
16
+ namespace League\OAuth2\Client\Provider;
17
+
18
  require 'vendor/autoload.php';
19
 
20
+ use League\OAuth2\Client\Provider\Exception\IdentityProviderException;
21
+ use League\OAuth2\Client\Token\AccessToken;
22
+ use League\OAuth2\Client\Tool\BearerAuthorizationTrait;
23
+ use Psr\Http\Message\ResponseInterface;
24
+
25
  session_start();
26
 
27
  //If this automatic URL doesn't work, set it yourself manually
32
  $clientId = 'RANDOMCHARS-----duv1n2.apps.googleusercontent.com';
33
  $clientSecret = 'RANDOMCHARS-----lGyjPcRtvP';
34
 
35
+ class Google extends AbstractProvider
36
+ {
37
+ use BearerAuthorizationTrait;
38
+
39
+ const ACCESS_TOKEN_RESOURCE_OWNER_ID = 'id';
40
+
41
+ /**
42
+ * @var string If set, this will be sent to google as the "access_type" parameter.
43
+ * @link https://developers.google.com/accounts/docs/OAuth2WebServer#offline
44
+ */
45
+ protected $accessType;
46
+
47
+ /**
48
+ * @var string If set, this will be sent to google as the "hd" parameter.
49
+ * @link https://developers.google.com/accounts/docs/OAuth2Login#hd-param
50
+ */
51
+ protected $hostedDomain;
52
+
53
+ /**
54
+ * @var string If set, this will be sent to google as the "scope" parameter.
55
+ * @link https://developers.google.com/gmail/api/auth/scopes
56
+ */
57
+ protected $scope;
58
+
59
+ public function getBaseAuthorizationUrl()
60
+ {
61
+ return 'https://accounts.google.com/o/oauth2/auth';
62
+ }
63
+
64
+ public function getBaseAccessTokenUrl(array $params)
65
+ {
66
+ return 'https://accounts.google.com/o/oauth2/token';
67
+ }
68
+
69
+ public function getResourceOwnerDetailsUrl(AccessToken $token)
70
+ {
71
+ return ' ';
72
+ }
73
+
74
+ protected function getAuthorizationParameters(array $options)
75
+ {
76
+ if (is_array($this->scope)) {
77
+ $separator = $this->getScopeSeparator();
78
+ $this->scope = implode($separator, $this->scope);
79
+ }
80
+
81
+ $params = array_merge(
82
+ parent::getAuthorizationParameters($options),
83
+ array_filter([
84
+ 'hd' => $this->hostedDomain,
85
+ 'access_type' => $this->accessType,
86
+ 'scope' => $this->scope,
87
+ // if the user is logged in with more than one account ask which one to use for the login!
88
+ 'authuser' => '-1'
89
+ ])
90
+ );
91
+ return $params;
92
+ }
93
+
94
+ protected function getDefaultScopes()
95
+ {
96
+ return [
97
+ 'email',
98
+ 'openid',
99
+ 'profile',
100
+ ];
101
+ }
102
+
103
+ protected function getScopeSeparator()
104
+ {
105
+ return ' ';
106
+ }
107
+
108
+ protected function checkResponse(ResponseInterface $response, $data)
109
+ {
110
+ if (!empty($data['error'])) {
111
+ $code = 0;
112
+ $error = $data['error'];
113
+
114
+ if (is_array($error)) {
115
+ $code = $error['code'];
116
+ $error = $error['message'];
117
+ }
118
+
119
+ throw new IdentityProviderException($error, $code, $data);
120
+ }
121
+ }
122
+
123
+ protected function createResourceOwner(array $response, AccessToken $token)
124
+ {
125
+ return new GoogleUser($response);
126
+ }
127
+ }
128
+
129
+
130
  //Set Redirect URI in Developer Console as [https/http]://<yourdomain>/<folder>/get_oauth_token.php
131
+ $provider = new Google(
132
  array(
133
  'clientId' => $clientId,
134
  'clientSecret' => $clientSecret,
135
  'redirectUri' => $redirectUri,
136
+ 'scope' => array('https://mail.google.com/'),
137
+ 'accessType' => 'offline'
138
  )
139
  );
140
 
PHPMailer/language/{phpmailer.lang-cz.php → phpmailer.lang-cs.php} RENAMED
File without changes
PHPMailer/language/{phpmailer.lang-dk.php → phpmailer.lang-da.php} RENAMED
File without changes
PHPMailer/language/phpmailer.lang-de.php CHANGED
@@ -4,22 +4,22 @@
4
  * @package PHPMailer
5
  */
6
 
7
- $PHPMAILER_LANG['authenticate'] = 'SMTP Fehler: Authentifizierung fehlgeschlagen.';
8
- $PHPMAILER_LANG['connect_host'] = 'SMTP Fehler: Konnte keine Verbindung zum SMTP-Host herstellen.';
9
- $PHPMAILER_LANG['data_not_accepted'] = 'SMTP Fehler: Daten werden nicht akzeptiert.';
10
- $PHPMAILER_LANG['empty_message'] = 'E-Mail Inhalt ist leer.';
11
- $PHPMAILER_LANG['encoding'] = 'Unbekanntes Encoding-Format: ';
12
  $PHPMAILER_LANG['execute'] = 'Konnte folgenden Befehl nicht ausführen: ';
13
  $PHPMAILER_LANG['file_access'] = 'Zugriff auf folgende Datei fehlgeschlagen: ';
14
- $PHPMAILER_LANG['file_open'] = 'Datei Fehler: konnte folgende Datei nicht öffnen: ';
15
  $PHPMAILER_LANG['from_failed'] = 'Die folgende Absenderadresse ist nicht korrekt: ';
16
- $PHPMAILER_LANG['instantiate'] = 'Mail Funktion konnte nicht initialisiert werden.';
17
- $PHPMAILER_LANG['invalid_address'] = 'E-Mail wird nicht gesendet, die Adresse ist ungültig: ';
18
  $PHPMAILER_LANG['mailer_not_supported'] = ' mailer wird nicht unterstützt.';
19
- $PHPMAILER_LANG['provide_address'] = 'Bitte geben Sie mindestens eine Empfänger E-Mailadresse an.';
20
- $PHPMAILER_LANG['recipients_failed'] = 'SMTP Fehler: Die folgenden Empfänger sind nicht korrekt: ';
21
  $PHPMAILER_LANG['signing'] = 'Fehler beim Signieren: ';
22
- $PHPMAILER_LANG['smtp_connect_failed'] = 'Verbindung zu SMTP Server fehlgeschlagen.';
23
- $PHPMAILER_LANG['smtp_error'] = 'Fehler vom SMTP Server: ';
24
  $PHPMAILER_LANG['variable_set'] = 'Kann Variable nicht setzen oder zurücksetzen: ';
25
- //$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
4
  * @package PHPMailer
5
  */
6
 
7
+ $PHPMAILER_LANG['authenticate'] = 'SMTP-Fehler: Authentifizierung fehlgeschlagen.';
8
+ $PHPMAILER_LANG['connect_host'] = 'SMTP-Fehler: Konnte keine Verbindung zum SMTP-Host herstellen.';
9
+ $PHPMAILER_LANG['data_not_accepted'] = 'SMTP-Fehler: Daten werden nicht akzeptiert.';
10
+ $PHPMAILER_LANG['empty_message'] = 'E-Mail-Inhalt ist leer.';
11
+ $PHPMAILER_LANG['encoding'] = 'Unbekannte Kodierung: ';
12
  $PHPMAILER_LANG['execute'] = 'Konnte folgenden Befehl nicht ausführen: ';
13
  $PHPMAILER_LANG['file_access'] = 'Zugriff auf folgende Datei fehlgeschlagen: ';
14
+ $PHPMAILER_LANG['file_open'] = 'Dateifehler: Konnte folgende Datei nicht öffnen: ';
15
  $PHPMAILER_LANG['from_failed'] = 'Die folgende Absenderadresse ist nicht korrekt: ';
16
+ $PHPMAILER_LANG['instantiate'] = 'Mail-Funktion konnte nicht initialisiert werden.';
17
+ $PHPMAILER_LANG['invalid_address'] = 'Die Adresse ist ungültig: ';
18
  $PHPMAILER_LANG['mailer_not_supported'] = ' mailer wird nicht unterstützt.';
19
+ $PHPMAILER_LANG['provide_address'] = 'Bitte geben Sie mindestens eine Empfängeradresse an.';
20
+ $PHPMAILER_LANG['recipients_failed'] = 'SMTP-Fehler: Die folgenden Empfänger sind nicht korrekt: ';
21
  $PHPMAILER_LANG['signing'] = 'Fehler beim Signieren: ';
22
+ $PHPMAILER_LANG['smtp_connect_failed'] = 'Verbindung zum SMTP-Server fehlgeschlagen.';
23
+ $PHPMAILER_LANG['smtp_error'] = 'Fehler vom SMTP-Server: ';
24
  $PHPMAILER_LANG['variable_set'] = 'Kann Variable nicht setzen oder zurücksetzen: ';
25
+ $PHPMAILER_LANG['extension_missing'] = 'Fehlende Erweiterung: ';
PHPMailer/language/phpmailer.lang-es.php CHANGED
@@ -23,4 +23,4 @@ $PHPMAILER_LANG['signing'] = 'Error al firmar: ';
23
  $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falló.';
24
  $PHPMAILER_LANG['smtp_error'] = 'Error del servidor SMTP: ';
25
  $PHPMAILER_LANG['variable_set'] = 'No se pudo configurar la variable: ';
26
- //$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
23
  $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falló.';
24
  $PHPMAILER_LANG['smtp_error'] = 'Error del servidor SMTP: ';
25
  $PHPMAILER_LANG['variable_set'] = 'No se pudo configurar la variable: ';
26
+ $PHPMAILER_LANG['extension_missing'] = 'Extensión faltante: ';
PHPMailer/language/phpmailer.lang-ka.php CHANGED
@@ -23,4 +23,4 @@ $PHPMAILER_LANG['signing'] = 'ხელმოწერის შე
23
  $PHPMAILER_LANG['smtp_connect_failed'] = 'შეცდომა SMTP სერვერთან დაკავშირებისას';
24
  $PHPMAILER_LANG['smtp_error'] = 'SMTP სერვერის შეცდომა: ';
25
  $PHPMAILER_LANG['variable_set'] = 'შეუძლებელია შემდეგი ცვლადის შექმნა ან შეცვლა: ';
26
- //$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
23
  $PHPMAILER_LANG['smtp_connect_failed'] = 'შეცდომა SMTP სერვერთან დაკავშირებისას';
24
  $PHPMAILER_LANG['smtp_error'] = 'SMTP სერვერის შეცდომა: ';
25
  $PHPMAILER_LANG['variable_set'] = 'შეუძლებელია შემდეგი ცვლადის შექმნა ან შეცვლა: ';
26
+ $PHPMAILER_LANG['extension_missing'] = 'ბიბლიოთეკა არ არსებობს: ';
PHPMailer/language/{phpmailer.lang-no.php → phpmailer.lang-nb.php} RENAMED
File without changes
PHPMailer/language/phpmailer.lang-pl.php CHANGED
@@ -23,4 +23,4 @@ $PHPMAILER_LANG['signing'] = 'Błąd podpisywania wiadomości: ';
23
  $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() zakończone niepowodzeniem.';
24
  $PHPMAILER_LANG['smtp_error'] = 'Błąd SMTP: ';
25
  $PHPMAILER_LANG['variable_set'] = 'Nie można ustawić lub zmodyfikować zmiennej: ';
26
- //$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
23
  $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() zakończone niepowodzeniem.';
24
  $PHPMAILER_LANG['smtp_error'] = 'Błąd SMTP: ';
25
  $PHPMAILER_LANG['variable_set'] = 'Nie można ustawić lub zmodyfikować zmiennej: ';
26
+ $PHPMAILER_LANG['extension_missing'] = 'Brakujące rozszerzenie: ';
PHPMailer/language/{phpmailer.lang-br.php → phpmailer.lang-pt_br.php} RENAMED
@@ -8,21 +8,21 @@
8
  */
9
 
10
  $PHPMAILER_LANG['authenticate'] = 'Erro de SMTP: Não foi possível autenticar.';
11
- $PHPMAILER_LANG['connect_host'] = 'Erro de SMTP: Não foi possível conectar com o servidor SMTP.';
12
  $PHPMAILER_LANG['data_not_accepted'] = 'Erro de SMTP: Dados rejeitados.';
13
- $PHPMAILER_LANG['empty_message'] = 'Corpo da mensagem vazio';
14
  $PHPMAILER_LANG['encoding'] = 'Codificação desconhecida: ';
15
  $PHPMAILER_LANG['execute'] = 'Não foi possível executar: ';
16
  $PHPMAILER_LANG['file_access'] = 'Não foi possível acessar o arquivo: ';
17
  $PHPMAILER_LANG['file_open'] = 'Erro de Arquivo: Não foi possível abrir o arquivo: ';
18
- $PHPMAILER_LANG['from_failed'] = 'Os endereços dos remententes a seguir falharam: ';
19
- $PHPMAILER_LANG['instantiate'] = 'Não foi possível iniciar uma instância da função mail.';
20
- $PHPMAILER_LANG['invalid_address'] = 'Não enviando, endereço de e-mail inválido: ';
21
  $PHPMAILER_LANG['mailer_not_supported'] = ' mailer não é suportado.';
22
- $PHPMAILER_LANG['provide_address'] = 'Você deve fornecer pelo menos um endereço de destinatário de e-mail.';
23
- $PHPMAILER_LANG['recipients_failed'] = 'Erro de SMTP: Os endereços de destinatário a seguir falharam: ';
24
- $PHPMAILER_LANG['signing'] = 'Erro ao assinar: ';
25
  $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falhou.';
26
  $PHPMAILER_LANG['smtp_error'] = 'Erro de servidor SMTP: ';
27
- $PHPMAILER_LANG['variable_set'] = 'Não foi possível definir ou resetar a variável: ';
28
  $PHPMAILER_LANG['extension_missing'] = 'Extensão ausente: ';
8
  */
9
 
10
  $PHPMAILER_LANG['authenticate'] = 'Erro de SMTP: Não foi possível autenticar.';
11
+ $PHPMAILER_LANG['connect_host'] = 'Erro de SMTP: Não foi possível conectar ao servidor SMTP.';
12
  $PHPMAILER_LANG['data_not_accepted'] = 'Erro de SMTP: Dados rejeitados.';
13
+ $PHPMAILER_LANG['empty_message'] = 'Mensagem vazia';
14
  $PHPMAILER_LANG['encoding'] = 'Codificação desconhecida: ';
15
  $PHPMAILER_LANG['execute'] = 'Não foi possível executar: ';
16
  $PHPMAILER_LANG['file_access'] = 'Não foi possível acessar o arquivo: ';
17
  $PHPMAILER_LANG['file_open'] = 'Erro de Arquivo: Não foi possível abrir o arquivo: ';
18
+ $PHPMAILER_LANG['from_failed'] = 'Os seguintes remententes falharam: ';
19
+ $PHPMAILER_LANG['instantiate'] = 'Não foi possível instanciar a função mail.';
20
+ $PHPMAILER_LANG['invalid_address'] = 'Endereço de e-mail inválido: ';
21
  $PHPMAILER_LANG['mailer_not_supported'] = ' mailer não é suportado.';
22
+ $PHPMAILER_LANG['provide_address'] = 'Você deve informar pelo menos um destinatário.';
23
+ $PHPMAILER_LANG['recipients_failed'] = 'Erro de SMTP: Os seguintes destinatários falharam: ';
24
+ $PHPMAILER_LANG['signing'] = 'Erro de Assinatura: ';
25
  $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falhou.';
26
  $PHPMAILER_LANG['smtp_error'] = 'Erro de servidor SMTP: ';
27
+ $PHPMAILER_LANG['variable_set'] = 'Não foi possível definir ou redefinir a variável: ';
28
  $PHPMAILER_LANG['extension_missing'] = 'Extensão ausente: ';
PHPMailer/language/phpmailer.lang-ro.php CHANGED
@@ -2,25 +2,25 @@
2
  /**
3
  * Romanian PHPMailer language file: refer to English translation for definitive list
4
  * @package PHPMailer
5
- * @author Catalin Constantin <catalin@dazoot.ro>
6
  */
7
 
8
- $PHPMAILER_LANG['authenticate'] = 'Eroare SMTP: Nu a functionat autentificarea.';
9
- $PHPMAILER_LANG['connect_host'] = 'Eroare SMTP: Nu m-am putut conecta la adresa SMTP.';
10
- $PHPMAILER_LANG['data_not_accepted'] = 'Eroare SMTP: Continutul mailului nu a fost acceptat.';
11
  $PHPMAILER_LANG['empty_message'] = 'Mesajul este gol.';
12
- $PHPMAILER_LANG['encoding'] = 'Encodare necunoscuta: ';
13
- $PHPMAILER_LANG['execute'] = 'Nu pot executa: ';
14
- $PHPMAILER_LANG['file_access'] = 'Nu pot accesa fisierul: ';
15
- $PHPMAILER_LANG['file_open'] = 'Eroare de fisier: Nu pot deschide fisierul: ';
16
- $PHPMAILER_LANG['from_failed'] = 'Urmatoarele adrese From au dat eroare: ';
17
- $PHPMAILER_LANG['instantiate'] = 'Nu am putut instantia functia mail.';
18
- $PHPMAILER_LANG['invalid_address'] = 'Adresa de email nu este valida: ';
19
  $PHPMAILER_LANG['mailer_not_supported'] = ' mailer nu este suportat.';
20
- $PHPMAILER_LANG['provide_address'] = 'Trebuie sa adaugati cel putin un recipient (adresa de mail).';
21
- $PHPMAILER_LANG['recipients_failed'] = 'Eroare SMTP: Urmatoarele adrese de mail au dat eroare: ';
22
- $PHPMAILER_LANG['signing'] = 'A aparut o problema la semnarea emailului. ';
23
- $PHPMAILER_LANG['smtp_connect_failed'] = 'Conectarea la serverul SMTP a esuat.';
24
- $PHPMAILER_LANG['smtp_error'] = 'A aparut o eroare la serverul SMTP. ';
25
  $PHPMAILER_LANG['variable_set'] = 'Nu se poate seta/reseta variabila. ';
26
- //$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
2
  /**
3
  * Romanian PHPMailer language file: refer to English translation for definitive list
4
  * @package PHPMailer
5
+ * @author Alex Florea <alecz.fia@gmail.com>
6
  */
7
 
8
+ $PHPMAILER_LANG['authenticate'] = 'Eroare SMTP: Autentificarea a eșuat.';
9
+ $PHPMAILER_LANG['connect_host'] = 'Eroare SMTP: Conectarea la serverul SMTP a eșuat.';
10
+ $PHPMAILER_LANG['data_not_accepted'] = 'Eroare SMTP: Datele nu au fost acceptate.';
11
  $PHPMAILER_LANG['empty_message'] = 'Mesajul este gol.';
12
+ $PHPMAILER_LANG['encoding'] = 'Encodare necunoscută: ';
13
+ $PHPMAILER_LANG['execute'] = 'Nu se poate executa următoarea comandă: ';
14
+ $PHPMAILER_LANG['file_access'] = 'Nu se poate accesa următorul fișier: ';
15
+ $PHPMAILER_LANG['file_open'] = 'Eroare fișier: Nu se poate deschide următorul fișier: ';
16
+ $PHPMAILER_LANG['from_failed'] = 'Următoarele adrese From au dat eroare: ';
17
+ $PHPMAILER_LANG['instantiate'] = 'Funcția mail nu a putut fi inițializată.';
18
+ $PHPMAILER_LANG['invalid_address'] = 'Adresa de email nu este validă: ';
19
  $PHPMAILER_LANG['mailer_not_supported'] = ' mailer nu este suportat.';
20
+ $PHPMAILER_LANG['provide_address'] = 'Trebuie adăugați cel puțin o adresă de email.';
21
+ $PHPMAILER_LANG['recipients_failed'] = 'Eroare SMTP: Următoarele adrese de email au eșuat: ';
22
+ $PHPMAILER_LANG['signing'] = 'A aparut o problemă la semnarea emailului. ';
23
+ $PHPMAILER_LANG['smtp_connect_failed'] = 'Conectarea la serverul SMTP a eșuat.';
24
+ $PHPMAILER_LANG['smtp_error'] = 'Eroare server SMTP: ';
25
  $PHPMAILER_LANG['variable_set'] = 'Nu se poate seta/reseta variabila. ';
26
+ $PHPMAILER_LANG['extension_missing'] = 'Lipsește extensia: ';
PHPMailer/language/phpmailer.lang-ru.php CHANGED
@@ -18,9 +18,9 @@ $PHPMAILER_LANG['instantiate'] = 'Невозможно запустит
18
  $PHPMAILER_LANG['provide_address'] = 'Пожалуйста, введите хотя бы один адрес e-mail получателя.';
19
  $PHPMAILER_LANG['mailer_not_supported'] = ' — почтовый сервер не поддерживается.';
20
  $PHPMAILER_LANG['recipients_failed'] = 'Ошибка SMTP: отправка по следующим адресам получателей не удалась: ';
21
- $PHPMAILER_LANG['empty_message'] = 'Пустое тело сообщения';
22
  $PHPMAILER_LANG['invalid_address'] = 'Не отослано, неправильный формат email адреса: ';
23
- $PHPMAILER_LANG['signing'] = 'Ошибка подписывания: ';
24
  $PHPMAILER_LANG['smtp_connect_failed'] = 'Ошибка соединения с SMTP-сервером';
25
  $PHPMAILER_LANG['smtp_error'] = 'Ошибка SMTP-сервера: ';
26
  $PHPMAILER_LANG['variable_set'] = 'Невозможно установить или переустановить переменную: ';
18
  $PHPMAILER_LANG['provide_address'] = 'Пожалуйста, введите хотя бы один адрес e-mail получателя.';
19
  $PHPMAILER_LANG['mailer_not_supported'] = ' — почтовый сервер не поддерживается.';
20
  $PHPMAILER_LANG['recipients_failed'] = 'Ошибка SMTP: отправка по следующим адресам получателей не удалась: ';
21
+ $PHPMAILER_LANG['empty_message'] = 'Пустое сообщение';
22
  $PHPMAILER_LANG['invalid_address'] = 'Не отослано, неправильный формат email адреса: ';
23
+ $PHPMAILER_LANG['signing'] = 'Ошибка подписи: ';
24
  $PHPMAILER_LANG['smtp_connect_failed'] = 'Ошибка соединения с SMTP-сервером';
25
  $PHPMAILER_LANG['smtp_error'] = 'Ошибка SMTP-сервера: ';
26
  $PHPMAILER_LANG['variable_set'] = 'Невозможно установить или переустановить переменную: ';
PHPMailer/language/{phpmailer.lang-se.php → phpmailer.lang-sv.php} RENAMED
@@ -15,12 +15,12 @@ $PHPMAILER_LANG['file_access'] = 'Ingen åtkomst till fil: ';
15
  $PHPMAILER_LANG['file_open'] = 'Fil fel: Kunde inte öppna fil: ';
16
  $PHPMAILER_LANG['from_failed'] = 'Följande avsändaradress är felaktig: ';
17
  $PHPMAILER_LANG['instantiate'] = 'Kunde inte initiera e-postfunktion.';
18
- //$PHPMAILER_LANG['invalid_address'] = 'Invalid address: ';
19
  $PHPMAILER_LANG['provide_address'] = 'Du måste ange minst en mottagares e-postadress.';
20
  $PHPMAILER_LANG['mailer_not_supported'] = ' mailer stöds inte.';
21
  $PHPMAILER_LANG['recipients_failed'] = 'SMTP fel: Följande mottagare är felaktig: ';
22
- //$PHPMAILER_LANG['signing'] = 'Signing Error: ';
23
- //$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
24
- //$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
25
- //$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
26
- //$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
15
  $PHPMAILER_LANG['file_open'] = 'Fil fel: Kunde inte öppna fil: ';
16
  $PHPMAILER_LANG['from_failed'] = 'Följande avsändaradress är felaktig: ';
17
  $PHPMAILER_LANG['instantiate'] = 'Kunde inte initiera e-postfunktion.';
18
+ $PHPMAILER_LANG['invalid_address'] = 'Felaktig adress: ';
19
  $PHPMAILER_LANG['provide_address'] = 'Du måste ange minst en mottagares e-postadress.';
20
  $PHPMAILER_LANG['mailer_not_supported'] = ' mailer stöds inte.';
21
  $PHPMAILER_LANG['recipients_failed'] = 'SMTP fel: Följande mottagare är felaktig: ';
22
+ $PHPMAILER_LANG['signing'] = 'Signerings fel: ';
23
+ $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() misslyckades.';
24
+ $PHPMAILER_LANG['smtp_error'] = 'SMTP server fel: ';
25
+ $PHPMAILER_LANG['variable_set'] = 'Kunde inte definiera eller återställa variabel: ';
26
+ $PHPMAILER_LANG['extension_missing'] = 'Tillägg ej tillgängligt: ';
main.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Gmail SMTP
4
- Version: 1.0.8
5
  Plugin URI: http://wphowto.net/
6
  Author: naa986
7
  Author URI: http://wphowto.net/
@@ -16,8 +16,8 @@ if (!defined('ABSPATH')){
16
 
17
  class GMAIL_SMTP {
18
 
19
- var $plugin_version = '1.0.8';
20
- var $phpmailer_version = '5.2.14';
21
  var $plugin_url;
22
  var $plugin_path;
23
 
1
  <?php
2
  /*
3
  Plugin Name: Gmail SMTP
4
+ Version: 1.0.9
5
  Plugin URI: http://wphowto.net/
6
  Author: naa986
7
  Author URI: http://wphowto.net/
16
 
17
  class GMAIL_SMTP {
18
 
19
+ var $plugin_version = '1.0.9';
20
+ var $phpmailer_version = '5.2.19';
21
  var $plugin_url;
22
  var $plugin_path;
23
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://wphowto.net/
4
  Tags: smtp, gmail, mail, mailer, phpmailer, wp_mail, email, oauth2
5
  Requires at least: 4.7
6
  Tested up to: 4.7
7
- Stable tag: 1.0.8
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -102,6 +102,9 @@ none
102
 
103
  == Changelog ==
104
 
 
 
 
105
  = 1.0.8 =
106
  * Gmail SMTP now supports the "wp_mail_failed" hook which fires after a phpmailerException is caught.
107
 
4
  Tags: smtp, gmail, mail, mailer, phpmailer, wp_mail, email, oauth2
5
  Requires at least: 4.7
6
  Tested up to: 4.7
7
+ Stable tag: 1.0.9
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
102
 
103
  == Changelog ==
104
 
105
+ = 1.0.9 =
106
+ * Updated the PHPMailer library to the latest version (5.2.19). This release also contains a critical security update for CVE-2016-10033 that was fixed in PHPMailer 5.2.18.
107
+
108
  = 1.0.8 =
109
  * Gmail SMTP now supports the "wp_mail_failed" hook which fires after a phpmailerException is caught.
110