<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[36083] trunk/src/wp-includes: Upgrade PHPMailer from 5.2.10 to 5.2.14.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/36083">36083</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/36083","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>pento</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2015-12-24 01:58:33 +0000 (Thu, 24 Dec 2015)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Upgrade PHPMailer from 5.2.10 to 5.2.14.
The full list of changes is available here: https://github.com/PHPMailer/PHPMailer/compare/v5.2.10...v5.2.14
Fixes <a href="https://core.trac.wordpress.org/ticket/35212">#35212</a> for trunk.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesclassphpmailerphp">trunk/src/wp-includes/class-phpmailer.php</a></li>
<li><a href="#trunksrcwpincludesclasssmtpphp">trunk/src/wp-includes/class-smtp.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludesclassphpmailerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-phpmailer.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-phpmailer.php 2015-12-24 00:25:06 UTC (rev 36082)
+++ trunk/src/wp-includes/class-phpmailer.php 2015-12-24 01:58:33 UTC (rev 36083)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -29,65 +29,66 @@
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The PHPMailer Version number.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public $Version = '5.2.10';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public $Version = '5.2.14';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Email priority.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Options: 1 = High, 3 = Normal, 5 = low.
- * @type integer
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Options: null (default), 1 = High, 3 = Normal, 5 = low.
+ * When null, the header is not set at all.
+ * @var integer
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public $Priority = 3;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public $Priority = null;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The character set of the message.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $CharSet = 'iso-8859-1';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The MIME Content-type of the message.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $ContentType = 'text/plain';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The message encoding.
</span><span class="cx" style="display: block; padding: 0 10px"> * Options: "8bit", "7bit", "binary", "base64", and "quoted-printable".
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $Encoding = '8bit';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Holds the most recent mailer error message.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $ErrorInfo = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The From email address for the message.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $From = 'root@localhost';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The From name of the message.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $FromName = 'Root User';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The Sender email (Return-Path) of the message.
</span><span class="cx" style="display: block; padding: 0 10px"> * If not empty, will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $Sender = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The Return-Path of the message.
</span><span class="cx" style="display: block; padding: 0 10px"> * If empty, it will be set to either From or Sender.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @deprecated Email senders should never set a return-path header;
</span><span class="cx" style="display: block; padding: 0 10px"> * it's the receiver's job (RFC5321 section 4.4), so this no longer does anything.
</span><span class="cx" style="display: block; padding: 0 10px"> * @link https://tools.ietf.org/html/rfc5321#section-4.4 RFC5321 reference
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -96,14 +97,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The Subject of the message.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $Subject = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * An HTML or plain text message body.
</span><span class="cx" style="display: block; padding: 0 10px"> * If HTML then call isHTML(true).
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $Body = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -112,7 +113,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * This body can be read by mail clients that do not have HTML email
</span><span class="cx" style="display: block; padding: 0 10px"> * capability such as mutt & Eudora.
</span><span class="cx" style="display: block; padding: 0 10px"> * Clients that can read HTML will view the normal Body.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $AltBody = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -122,27 +123,27 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * To generate iCal events, use the bundled extras/EasyPeasyICS.php class or iCalcreator
</span><span class="cx" style="display: block; padding: 0 10px"> * @link http://sprain.ch/blog/downloads/php-class-easypeasyics-create-ical-files-with-php/
</span><span class="cx" style="display: block; padding: 0 10px"> * @link http://kigkonsult.se/iCalcreator/
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $Ical = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The complete compiled MIME message body.
</span><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $MIMEBody = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The complete compiled MIME message headers.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $MIMEHeader = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Extra headers that createHeader() doesn't fold in.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $mailHeader = '';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -150,64 +151,64 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Word-wrap the message body to this number of chars.
</span><span class="cx" style="display: block; padding: 0 10px"> * Set to 0 to not wrap. A useful value here is 78, for RFC2822 section 2.1.1 compliance.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type integer
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var integer
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $WordWrap = 0;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Which method to use to send mail.
</span><span class="cx" style="display: block; padding: 0 10px"> * Options: "mail", "sendmail", or "smtp".
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $Mailer = 'mail';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The path to the sendmail program.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $Sendmail = '/usr/sbin/sendmail';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Whether mail() uses a fully sendmail-compatible MTA.
</span><span class="cx" style="display: block; padding: 0 10px"> * One which supports sendmail's "-oi -f" options.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type boolean
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var boolean
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $UseSendmailOptions = true;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Path to PHPMailer plugins.
</span><span class="cx" style="display: block; padding: 0 10px"> * Useful if the SMTP class is not in the PHP include path.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @deprecated Should not be needed now there is an autoloader.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $PluginDir = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * The email address that a reading confirmation should be sent to.
- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * The email address that a reading confirmation should be sent to, also known as read receipt.
+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $ConfirmReadingTo = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * The hostname to use in Message-Id and Received headers
- * and as default HELO string.
- * If empty, the value returned
- * by SERVER_NAME is used or 'localhost.localdomain'.
- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * The hostname to use in the Message-ID header and as default HELO string.
+ * If empty, PHPMailer attempts to find one with, in order,
+ * $_SERVER['SERVER_NAME'], gethostname(), php_uname('n'), or the value
+ * 'localhost.localdomain'.
+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $Hostname = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * An ID to be used in the Message-Id header.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * An ID to be used in the Message-ID header.
</ins><span class="cx" style="display: block; padding: 0 10px"> * If empty, a unique id will be generated.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $MessageID = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The message Date to be used in the Date header.
</span><span class="cx" style="display: block; padding: 0 10px"> * If empty, the current date will be added.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $MessageDate = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -220,21 +221,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * You can also specify encryption type, for example:
</span><span class="cx" style="display: block; padding: 0 10px"> * (e.g. "tls://smtp1.example.com:587;ssl://smtp2.example.com:465").
</span><span class="cx" style="display: block; padding: 0 10px"> * Hosts will be tried in order.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $Host = 'localhost';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The default SMTP server port.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type integer
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var integer
</ins><span class="cx" style="display: block; padding: 0 10px"> * @TODO Why is this needed when the SMTP class takes care of it?
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $Port = 25;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The SMTP HELO of the message.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Default is $Hostname.
- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Default is $Hostname. If $Hostname is empty, PHPMailer attempts to find
+ * one with the same method described above for $Hostname.
+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see PHPMailer::$Hostname
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $Helo = '';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -242,7 +244,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * What kind of encryption to use on the SMTP connection.
</span><span class="cx" style="display: block; padding: 0 10px"> * Options: '', 'ssl' or 'tls'
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $SMTPSecure = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -250,14 +252,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Whether to enable TLS encryption automatically if a server supports it,
</span><span class="cx" style="display: block; padding: 0 10px"> * even if `SMTPSecure` is not set to 'tls'.
</span><span class="cx" style="display: block; padding: 0 10px"> * Be aware that in PHP >= 5.6 this requires that the server's certificates are valid.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type boolean
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var boolean
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $SMTPAutoTLS = true;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Whether to use SMTP authentication.
</span><span class="cx" style="display: block; padding: 0 10px"> * Uses the Username and Password properties.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type boolean
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var boolean
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see PHPMailer::$Username
</span><span class="cx" style="display: block; padding: 0 10px"> * @see PHPMailer::$Password
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -265,47 +267,47 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Options array passed to stream_context_create when connecting via SMTP.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var array
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $SMTPOptions = array();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * SMTP username.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $Username = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * SMTP password.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $Password = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * SMTP auth type.
</span><span class="cx" style="display: block; padding: 0 10px"> * Options are LOGIN (default), PLAIN, NTLM, CRAM-MD5
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $AuthType = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * SMTP realm.
</span><span class="cx" style="display: block; padding: 0 10px"> * Used for NTLM auth
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $Realm = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * SMTP workstation.
</span><span class="cx" style="display: block; padding: 0 10px"> * Used for NTLM auth
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $Workstation = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The SMTP server timeout in seconds.
</span><span class="cx" style="display: block; padding: 0 10px"> * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type integer
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var integer
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $Timeout = 300;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -318,7 +320,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * * `2` Data and commands
</span><span class="cx" style="display: block; padding: 0 10px"> * * `3` As 2 plus connection status
</span><span class="cx" style="display: block; padding: 0 10px"> * * `4` Low-level data output
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type integer
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var integer
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see SMTP::$do_debug
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $SMTPDebug = 0;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -334,7 +336,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * <code>
</span><span class="cx" style="display: block; padding: 0 10px"> * $mail->Debugoutput = function($str, $level) {echo "debug level $level; message: $str";};
</span><span class="cx" style="display: block; padding: 0 10px"> * </code>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string|callable
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string|callable
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see SMTP::$Debugoutput
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $Debugoutput = 'echo';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -343,20 +345,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Whether to keep SMTP connection open after each message.
</span><span class="cx" style="display: block; padding: 0 10px"> * If this is set to true then to close the connection
</span><span class="cx" style="display: block; padding: 0 10px"> * requires an explicit call to smtpClose().
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type boolean
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var boolean
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $SMTPKeepAlive = false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Whether to split multiple to addresses into multiple messages
</span><span class="cx" style="display: block; padding: 0 10px"> * or send them all in one message.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type boolean
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var boolean
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $SingleTo = false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Storage for addresses when SingleTo is enabled.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var array
</ins><span class="cx" style="display: block; padding: 0 10px"> * @TODO This should really not be public
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $SingleToArray = array();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -364,15 +366,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Whether to generate VERP addresses on send.
</span><span class="cx" style="display: block; padding: 0 10px"> * Only applicable when sending via SMTP.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @link http://en.wikipedia.org/wiki/Variable_envelope_return_path
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @link https://en.wikipedia.org/wiki/Variable_envelope_return_path
</ins><span class="cx" style="display: block; padding: 0 10px"> * @link http://www.postfix.org/VERP_README.html Postfix VERP info
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type boolean
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var boolean
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $do_verp = false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Whether to allow sending messages with an empty body.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type boolean
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var boolean
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $AllowEmpty = false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -380,40 +382,40 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * The default line ending.
</span><span class="cx" style="display: block; padding: 0 10px"> * @note The default remains "\n". We force CRLF where we know
</span><span class="cx" style="display: block; padding: 0 10px"> * it must be used via self::CRLF.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $LE = "\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * DKIM selector.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $DKIM_selector = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * DKIM Identity.
</span><span class="cx" style="display: block; padding: 0 10px"> * Usually the email address used as the source of the email
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $DKIM_identity = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * DKIM passphrase.
</span><span class="cx" style="display: block; padding: 0 10px"> * Used if your key is encrypted.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $DKIM_passphrase = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * DKIM signing domain name.
</span><span class="cx" style="display: block; padding: 0 10px"> * @example 'example.com'
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $DKIM_domain = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * DKIM private key file path.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $DKIM_private = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -433,48 +435,48 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * string $subject the subject
</span><span class="cx" style="display: block; padding: 0 10px"> * string $body the email body
</span><span class="cx" style="display: block; padding: 0 10px"> * string $from email address of sender
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $action_function = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * What to put in the X-Mailer header.
</span><span class="cx" style="display: block; padding: 0 10px"> * Options: An empty string for PHPMailer default, whitespace for none, or a string to use
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $XMailer = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * An instance of the SMTP sender class.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type SMTP
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var SMTP
</ins><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $smtp = null;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * The array of 'to' addresses.
- * @type array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * The array of 'to' names and addresses.
+ * @var array
</ins><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $to = array();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * The array of 'cc' addresses.
- * @type array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * The array of 'cc' names and addresses.
+ * @var array
</ins><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $cc = array();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * The array of 'bcc' addresses.
- * @type array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * The array of 'bcc' names and addresses.
+ * @var array
</ins><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $bcc = array();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The array of reply-to names and addresses.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var array
</ins><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $ReplyTo = array();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -482,77 +484,100 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * An array of all kinds of addresses.
</span><span class="cx" style="display: block; padding: 0 10px"> * Includes all of $to, $cc, $bcc
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var array
</ins><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @see PHPMailer::$to @see PHPMailer::$cc @see PHPMailer::$bcc
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $all_recipients = array();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * An array of names and addresses queued for validation.
+ * In send(), valid and non duplicate entries are moved to $all_recipients
+ * and one of $to, $cc, or $bcc.
+ * This array is used only for addresses with IDN.
+ * @var array
+ * @access protected
+ * @see PHPMailer::$to @see PHPMailer::$cc @see PHPMailer::$bcc
+ * @see PHPMailer::$all_recipients
+ */
+ protected $RecipientsQueue = array();
+
+ /**
+ * An array of reply-to names and addresses queued for validation.
+ * In send(), valid and non duplicate entries are moved to $ReplyTo.
+ * This array is used only for addresses with IDN.
+ * @var array
+ * @access protected
+ * @see PHPMailer::$ReplyTo
+ */
+ protected $ReplyToQueue = array();
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * The array of attachments.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var array
</ins><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $attachment = array();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The array of custom headers.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var array
</ins><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $CustomHeader = array();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The most recent Message-ID (including angular brackets).
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $lastMessageID = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The message's MIME type.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $message_type = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The array of MIME boundary strings.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var array
</ins><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $boundary = array();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The array of available languages.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var array
</ins><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $language = array();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The number of errors encountered.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type integer
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var integer
</ins><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $error_count = 0;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The S/MIME certificate file path.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $sign_cert_file = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The S/MIME key file path.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $sign_key_file = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The optional S/MIME extra certificates ("CA Chain") file path.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $sign_extracerts_file = '';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -560,21 +585,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The S/MIME password for the key.
</span><span class="cx" style="display: block; padding: 0 10px"> * Used only if the key is encrypted.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $sign_key_pass = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Whether to throw exceptions for errors.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type boolean
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var boolean
</ins><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $exceptions = false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Unique ID used for message ID and boundaries.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $uniqueid = '';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -601,7 +626,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The maximum line length allowed by RFC 2822 section 2.1.1
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type integer
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var integer
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> const MAX_LINE_LENGTH = 998;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -763,82 +788,128 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Add a "To" address.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $address
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $address The email address to send to
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $name
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return boolean true on success, false if address already used
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return boolean true on success, false if address already used or invalid in some way
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function addAddress($address, $name = '')
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->addAnAddress('to', $address, $name);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->addOrEnqueueAnAddress('to', $address, $name);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Add a "CC" address.
</span><span class="cx" style="display: block; padding: 0 10px"> * @note: This function works with the SMTP mailer on win32, not with the "mail" mailer.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $address
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $address The email address to send to
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $name
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return boolean true on success, false if address already used
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return boolean true on success, false if address already used or invalid in some way
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function addCC($address, $name = '')
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->addAnAddress('cc', $address, $name);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->addOrEnqueueAnAddress('cc', $address, $name);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Add a "BCC" address.
</span><span class="cx" style="display: block; padding: 0 10px"> * @note: This function works with the SMTP mailer on win32, not with the "mail" mailer.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $address
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $address The email address to send to
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $name
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return boolean true on success, false if address already used
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return boolean true on success, false if address already used or invalid in some way
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function addBCC($address, $name = '')
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->addAnAddress('bcc', $address, $name);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->addOrEnqueueAnAddress('bcc', $address, $name);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Add a "Reply-to" address.
- * @param string $address
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Add a "Reply-To" address.
+ * @param string $address The email address to reply to
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $name
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return boolean
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return boolean true on success, false if address already used or invalid in some way
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function addReplyTo($address, $name = '')
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->addAnAddress('Reply-To', $address, $name);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->addOrEnqueueAnAddress('Reply-To', $address, $name);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Add an address to one of the recipient arrays.
- * Addresses that have been added already return false, but do not throw exceptions
- * @param string $kind One of 'to', 'cc', 'bcc', 'ReplyTo'
- * @param string $address The email address to send to
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Add an address to one of the recipient arrays or to the ReplyTo array. Because PHPMailer
+ * can't validate addresses with an IDN without knowing the PHPMailer::$CharSet (that can still
+ * be modified after calling this function), addition of such addresses is delayed until send().
+ * Addresses that have been added already return false, but do not throw exceptions.
+ * @param string $kind One of 'to', 'cc', 'bcc', or 'ReplyTo'
+ * @param string $address The email address to send, resp. to reply to
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $name
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws phpmailerException
</span><span class="cx" style="display: block; padding: 0 10px"> * @return boolean true on success, false if address already used or invalid in some way
</span><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ protected function addOrEnqueueAnAddress($kind, $address, $name)
+ {
+ $address = trim($address);
+ $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
+ if (($pos = strrpos($address, '@')) === false) {
+ // At-sign is misssing.
+ $error_message = $this->lang('invalid_address') . $address;
+ $this->setError($error_message);
+ $this->edebug($error_message);
+ if ($this->exceptions) {
+ throw new phpmailerException($error_message);
+ }
+ return false;
+ }
+ $params = array($kind, $address, $name);
+ // Enqueue addresses with IDN until we know the PHPMailer::$CharSet.
+ if ($this->has8bitChars(substr($address, ++$pos)) and $this->idnSupported()) {
+ if ($kind != 'Reply-To') {
+ if (!array_key_exists($address, $this->RecipientsQueue)) {
+ $this->RecipientsQueue[$address] = $params;
+ return true;
+ }
+ } else {
+ if (!array_key_exists($address, $this->ReplyToQueue)) {
+ $this->ReplyToQueue[$address] = $params;
+ return true;
+ }
+ }
+ return false;
+ }
+ // Immediately add standard addresses without IDN.
+ return call_user_func_array(array($this, 'addAnAddress'), $params);
+ }
+
+ /**
+ * Add an address to one of the recipient arrays or to the ReplyTo array.
+ * Addresses that have been added already return false, but do not throw exceptions.
+ * @param string $kind One of 'to', 'cc', 'bcc', or 'ReplyTo'
+ * @param string $address The email address to send, resp. to reply to
+ * @param string $name
+ * @throws phpmailerException
+ * @return boolean true on success, false if address already used or invalid in some way
+ * @access protected
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> protected function addAnAddress($kind, $address, $name = '')
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (!preg_match('/^(to|cc|bcc|Reply-To)$/', $kind)) {
- $this->setError($this->lang('Invalid recipient array') . ': ' . $kind);
- $this->edebug($this->lang('Invalid recipient array') . ': ' . $kind);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!in_array($kind, array('to', 'cc', 'bcc', 'Reply-To'))) {
+ $error_message = $this->lang('Invalid recipient kind: ') . $kind;
+ $this->setError($error_message);
+ $this->edebug($error_message);
</ins><span class="cx" style="display: block; padding: 0 10px"> if ($this->exceptions) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- throw new phpmailerException('Invalid recipient array: ' . $kind);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ throw new phpmailerException($error_message);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $address = trim($address);
- $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
</del><span class="cx" style="display: block; padding: 0 10px"> if (!$this->validateAddress($address)) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->setError($this->lang('invalid_address') . ': ' . $address);
- $this->edebug($this->lang('invalid_address') . ': ' . $address);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $error_message = $this->lang('invalid_address') . $address;
+ $this->setError($error_message);
+ $this->edebug($error_message);
</ins><span class="cx" style="display: block; padding: 0 10px"> if ($this->exceptions) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- throw new phpmailerException($this->lang('invalid_address') . ': ' . $address);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ throw new phpmailerException($error_message);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if ($kind != 'Reply-To') {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (!isset($this->all_recipients[strtolower($address)])) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!array_key_exists(strtolower($address), $this->all_recipients)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> array_push($this->$kind, array($address, $name));
</span><span class="cx" style="display: block; padding: 0 10px"> $this->all_recipients[strtolower($address)] = true;
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -864,11 +935,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $address = trim($address);
</span><span class="cx" style="display: block; padding: 0 10px"> $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (!$this->validateAddress($address)) {
- $this->setError($this->lang('invalid_address') . ': ' . $address);
- $this->edebug($this->lang('invalid_address') . ': ' . $address);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Don't validate now addresses with IDN. Will be done in send().
+ if (($pos = strrpos($address, '@')) === false or
+ (!$this->has8bitChars(substr($address, ++$pos)) or !$this->idnSupported()) and
+ !$this->validateAddress($address)) {
+ $error_message = $this->lang('invalid_address') . $address;
+ $this->setError($error_message);
+ $this->edebug($error_message);
</ins><span class="cx" style="display: block; padding: 0 10px"> if ($this->exceptions) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- throw new phpmailerException($this->lang('invalid_address') . ': ' . $address);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ throw new phpmailerException($error_message);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -898,10 +973,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Check that a string looks like an email address.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $address The email address to check
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $patternselect A selector for the validation pattern to use :
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * * `auto` Pick strictest one automatically;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * * `auto` Pick best pattern automatically;
</ins><span class="cx" style="display: block; padding: 0 10px"> * * `pcre8` Use the squiloople.com pattern, requires PCRE > 8.0, PHP >= 5.3.2, 5.2.14;
</span><span class="cx" style="display: block; padding: 0 10px"> * * `pcre` Use old PCRE implementation;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * * `php` Use PHP built-in FILTER_VALIDATE_EMAIL; same as pcre8 but does not allow 'dotless' domains;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * * `php` Use PHP built-in FILTER_VALIDATE_EMAIL;
</ins><span class="cx" style="display: block; padding: 0 10px"> * * `html5` Use the pattern given by the HTML5 spec for 'email' type form input elements.
</span><span class="cx" style="display: block; padding: 0 10px"> * * `noregex` Don't use a regex: super fast, really dumb.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return boolean
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -910,6 +985,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public static function validateAddress($address, $patternselect = 'auto')
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ //Reject line breaks in addresses; it's valid RFC5322, but not RFC5321
+ if (strpos($address, "\n") !== false or strpos($address, "\r") !== false) {
+ return false;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> if (!$patternselect or $patternselect == 'auto') {
</span><span class="cx" style="display: block; padding: 0 10px"> //Check this constant first so it works when extension_loaded() is disabled by safe mode
</span><span class="cx" style="display: block; padding: 0 10px"> //Constant was added in PHP 5.2.4
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -990,6 +1069,48 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Tells whether IDNs (Internationalized Domain Names) are supported or not. This requires the
+ * "intl" and "mbstring" PHP extensions.
+ * @return bool "true" if required functions for IDN support are present
+ */
+ public function idnSupported()
+ {
+ // @TODO: Write our own "idn_to_ascii" function for PHP <= 5.2.
+ return function_exists('idn_to_ascii') and function_exists('mb_convert_encoding');
+ }
+
+ /**
+ * Converts IDN in given email address to its ASCII form, also known as punycode, if possible.
+ * Important: Address must be passed in same encoding as currently set in PHPMailer::$CharSet.
+ * This function silently returns unmodified address if:
+ * - No conversion is necessary (i.e. domain name is not an IDN, or is already in ASCII form)
+ * - Conversion to punycode is impossible (e.g. required PHP functions are not available)
+ * or fails for any reason (e.g. domain has characters not allowed in an IDN)
+ * @see PHPMailer::$CharSet
+ * @param string $address The email address to convert
+ * @return string The encoded address in ASCII form
+ */
+ public function punyencodeAddress($address)
+ {
+ // Verify we have required functions, CharSet, and at-sign.
+ if ($this->idnSupported() and
+ !empty($this->CharSet) and
+ ($pos = strrpos($address, '@')) !== false) {
+ $domain = substr($address, ++$pos);
+ // Verify CharSet string is a valid one, and domain properly encoded in this CharSet.
+ if ($this->has8bitChars($domain) and @mb_check_encoding($domain, $this->CharSet)) {
+ $domain = mb_convert_encoding($domain, 'UTF-8', $this->CharSet);
+ if (($punycode = defined('INTL_IDNA_VARIANT_UTS46') ?
+ idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46) :
+ idn_to_ascii($domain)) !== false) {
+ return substr($address, 0, $pos) . $punycode;
+ }
+ }
+ }
+ return $address;
+ }
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Create a message and send it.
</span><span class="cx" style="display: block; padding: 0 10px"> * Uses the sending method specified by $Mailer.
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws phpmailerException
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1020,17 +1141,41 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function preSend()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> try {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->error_count = 0; // Reset errors
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->mailHeader = '';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ // Dequeue recipient and Reply-To addresses with IDN
+ foreach (array_merge($this->RecipientsQueue, $this->ReplyToQueue) as $params) {
+ $params[1] = $this->punyencodeAddress($params[1]);
+ call_user_func_array(array($this, 'addAnAddress'), $params);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> if ((count($this->to) + count($this->cc) + count($this->bcc)) < 1) {
</span><span class="cx" style="display: block; padding: 0 10px"> throw new phpmailerException($this->lang('provide_address'), self::STOP_CRITICAL);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Validate From, Sender, and ConfirmReadingTo addresses
+ foreach (array('From', 'Sender', 'ConfirmReadingTo') as $address_kind) {
+ $this->$address_kind = trim($this->$address_kind);
+ if (empty($this->$address_kind)) {
+ continue;
+ }
+ $this->$address_kind = $this->punyencodeAddress($this->$address_kind);
+ if (!$this->validateAddress($this->$address_kind)) {
+ $error_message = $this->lang('invalid_address') . $this->$address_kind;
+ $this->setError($error_message);
+ $this->edebug($error_message);
+ if ($this->exceptions) {
+ throw new phpmailerException($error_message);
+ }
+ return false;
+ }
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> // Set whether the message is multipart/alternative
</span><span class="cx" style="display: block; padding: 0 10px"> if (!empty($this->AltBody)) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->ContentType = 'multipart/alternative';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->error_count = 0; // Reset errors
</del><span class="cx" style="display: block; padding: 0 10px"> $this->setMessageType();
</span><span class="cx" style="display: block; padding: 0 10px"> // Refuse to send an empty message unless we are specifically allowing it
</span><span class="cx" style="display: block; padding: 0 10px"> if (!$this->AllowEmpty and empty($this->Body)) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1171,7 +1316,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> fputs($mail, $header);
</span><span class="cx" style="display: block; padding: 0 10px"> fputs($mail, $body);
</span><span class="cx" style="display: block; padding: 0 10px"> $result = pclose($mail);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->doCallback(($result == 0), $this->to, $this->cc, $this->bcc, $this->Subject, $body, $this->From);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->doCallback(
+ ($result == 0),
+ $this->to,
+ $this->cc,
+ $this->bcc,
+ $this->Subject,
+ $body,
+ $this->From
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ($result != 0) {
</span><span class="cx" style="display: block; padding: 0 10px"> throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1458,7 +1611,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'file_open' => 'File Error: Could not open file: ',
</span><span class="cx" style="display: block; padding: 0 10px"> 'from_failed' => 'The following From address failed: ',
</span><span class="cx" style="display: block; padding: 0 10px"> 'instantiate' => 'Could not instantiate mail function.',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'invalid_address' => 'Invalid address',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'invalid_address' => 'Invalid address: ',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'mailer_not_supported' => ' mailer is not supported.',
</span><span class="cx" style="display: block; padding: 0 10px"> 'provide_address' => 'You must provide at least one recipient email address.',
</span><span class="cx" style="display: block; padding: 0 10px"> 'recipients_failed' => 'SMTP Error: The following recipients failed: ',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1723,7 +1876,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $result .= $this->headerLine('Date', $this->MessageDate);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> // To be created automatically by mail()
</span><span class="cx" style="display: block; padding: 0 10px"> if ($this->SingleTo) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($this->Mailer != 'mail') {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1769,14 +1921,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ($this->MessageID != '') {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->lastMessageID = $this->MessageID;
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->lastMessageID = sprintf('<%s@%s>', $this->uniqueid, $this->ServerHostname());
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->lastMessageID = sprintf('<%s@%s>', $this->uniqueid, $this->serverHostname());
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $result .= $this->headerLine('Message-ID', $this->lastMessageID);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $result .= $this->headerLine('X-Priority', $this->Priority);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!is_null($this->Priority)) {
+ $result .= $this->headerLine('X-Priority', $this->Priority);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> if ($this->XMailer == '') {
</span><span class="cx" style="display: block; padding: 0 10px"> $result .= $this->headerLine(
</span><span class="cx" style="display: block; padding: 0 10px"> 'X-Mailer',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'PHPMailer ' . $this->Version . ' (https://github.com/PHPMailer/PHPMailer/)'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'PHPMailer ' . $this->Version . ' (https://github.com/PHPMailer/PHPMailer)'
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $myXmailer = trim($this->XMailer);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1786,7 +1940,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ($this->ConfirmReadingTo != '') {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $result .= $this->headerLine('Disposition-Notification-To', '<' . trim($this->ConfirmReadingTo) . '>');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $result .= $this->headerLine('Disposition-Notification-To', '<' . $this->ConfirmReadingTo . '>');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Add custom headers
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2266,18 +2420,27 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $type = $attachment[4];
</span><span class="cx" style="display: block; padding: 0 10px"> $disposition = $attachment[6];
</span><span class="cx" style="display: block; padding: 0 10px"> $cid = $attachment[7];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ($disposition == 'inline' && isset($cidUniq[$cid])) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ($disposition == 'inline' && array_key_exists($cid, $cidUniq)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $cidUniq[$cid] = true;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $mime[] = sprintf('--%s%s', $boundary, $this->LE);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $mime[] = sprintf(
- 'Content-Type: %s; name="%s"%s',
- $type,
- $this->encodeHeader($this->secureHeader($name)),
- $this->LE
- );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ //Only include a filename property if we have one
+ if (!empty($name)) {
+ $mime[] = sprintf(
+ 'Content-Type: %s; name="%s"%s',
+ $type,
+ $this->encodeHeader($this->secureHeader($name)),
+ $this->LE
+ );
+ } else {
+ $mime[] = sprintf(
+ 'Content-Type: %s%s',
+ $type,
+ $this->LE
+ );
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> // RFC1341 part 5 says 7bit is assumed if not specified
</span><span class="cx" style="display: block; padding: 0 10px"> if ($encoding != '7bit') {
</span><span class="cx" style="display: block; padding: 0 10px"> $mime[] = sprintf('Content-Transfer-Encoding: %s%s', $encoding, $this->LE);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2301,12 +2464,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->LE . $this->LE
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $mime[] = sprintf(
- 'Content-Disposition: %s; filename=%s%s',
- $disposition,
- $encoded_name,
- $this->LE . $this->LE
- );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!empty($encoded_name)) {
+ $mime[] = sprintf(
+ 'Content-Disposition: %s; filename=%s%s',
+ $disposition,
+ $encoded_name,
+ $this->LE . $this->LE
+ );
+ } else {
+ $mime[] = sprintf(
+ 'Content-Disposition: %s%s',
+ $disposition,
+ $this->LE . $this->LE
+ );
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $mime[] = $this->LE;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2340,7 +2511,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $path The full path to the file
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable'
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws phpmailerException
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @see EncodeFile(encodeFile
</del><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2560,7 +2730,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> // Use native function if it's available (>= PHP5.3)
</span><span class="cx" style="display: block; padding: 0 10px"> if (function_exists('quoted_printable_encode')) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->fixEOL(quoted_printable_encode($string));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return quoted_printable_encode($string);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> // Fall back to a pure PHP implementation
</span><span class="cx" style="display: block; padding: 0 10px"> $string = str_replace(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2568,8 +2738,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> array(' ', "\r\n=2E", "\r\n", '='),
</span><span class="cx" style="display: block; padding: 0 10px"> rawurlencode($string)
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $string = preg_replace('/[^\r\n]{' . ($line_max - 3) . '}[^=\r\n]{2}/', "$0=\r\n", $string);
- return $this->fixEOL($string);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return preg_replace('/[^\r\n]{' . ($line_max - 3) . '}[^=\r\n]{2}/', "$0=\r\n", $string);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2638,7 +2807,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return str_replace(' ', '_', $encoded);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Add a string or binary attachment (non-filesystem).
</span><span class="cx" style="display: block; padding: 0 10px"> * This method can be used to attach ascii or binary data,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2744,7 +2912,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $disposition = 'inline'
</span><span class="cx" style="display: block; padding: 0 10px"> ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // If a MIME type is not specified, try to work it out from the name
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ($type == '') {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ($type == '' and !empty($name)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $type = self::filenameToType($name);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2801,6 +2969,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Clear queued addresses of given kind.
+ * @access protected
+ * @param string $kind 'to', 'cc', or 'bcc'
+ * @return void
+ */
+ public function clearQueuedAddresses($kind)
+ {
+ $RecipientsQueue = $this->RecipientsQueue;
+ foreach ($RecipientsQueue as $address => $params) {
+ if ($params[0] == $kind) {
+ unset($this->RecipientsQueue[$address]);
+ }
+ }
+ }
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Clear all To recipients.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return void
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2810,6 +2994,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> unset($this->all_recipients[strtolower($to[0])]);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $this->to = array();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->clearQueuedAddresses('to');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2822,6 +3007,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> unset($this->all_recipients[strtolower($cc[0])]);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $this->cc = array();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->clearQueuedAddresses('cc');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2834,6 +3020,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> unset($this->all_recipients[strtolower($bcc[0])]);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $this->bcc = array();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->clearQueuedAddresses('bcc');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2843,6 +3030,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function clearReplyTos()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->ReplyTo = array();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->ReplyToQueue = array();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2855,6 +3043,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->cc = array();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->bcc = array();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->all_recipients = array();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->RecipientsQueue = array();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3011,8 +3200,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Returns all custom headers
- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Returns all custom headers.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return array
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function getCustomHeaders()
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3029,13 +3217,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $message HTML message string
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $basedir baseline directory for path
</span><span class="cx" style="display: block; padding: 0 10px"> * @param boolean|callable $advanced Whether to use the internal HTML to text converter
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * or your own custom converter @see html2text()
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * or your own custom converter @see PHPMailer::html2text()
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return string $message
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function msgHTML($message, $basedir = '', $advanced = false)
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> preg_match_all('/(src|background)=["\'](.*)["\']/Ui', $message, $images);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (isset($images[2])) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (array_key_exists(2, $images)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ($images[2] as $imgindex => $url) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Convert data URIs into embedded images
</span><span class="cx" style="display: block; padding: 0 10px"> if (preg_match('#^data:(image[^;,]*)(;base64)?,#', $url, $match)) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3046,15 +3234,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = rawurldecode($data);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $cid = md5($url) . '@phpmailer.0'; // RFC2392 S 2
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ($this->addStringEmbeddedImage($data, $cid, '', 'base64', $match[1])) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ($this->addStringEmbeddedImage($data, $cid, 'embed' . $imgindex, 'base64', $match[1])) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $message = str_replace(
</span><span class="cx" style="display: block; padding: 0 10px"> $images[0][$imgindex],
</span><span class="cx" style="display: block; padding: 0 10px"> $images[1][$imgindex] . '="cid:' . $cid . '"',
</span><span class="cx" style="display: block; padding: 0 10px"> $message
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif (!preg_match('#^[A-z]+://#', $url)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif (substr($url, 0, 4) !== 'cid:' && !preg_match('#^[A-z]+://#', $url)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> // Do not change urls for absolute images (thanks to corvuscorax)
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Do not change urls that are already inline images
</ins><span class="cx" style="display: block; padding: 0 10px"> $filename = basename($url);
</span><span class="cx" style="display: block; padding: 0 10px"> $directory = dirname($url);
</span><span class="cx" style="display: block; padding: 0 10px"> if ($directory == '.') {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3144,6 +3333,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'bin' => 'application/macbinary',
</span><span class="cx" style="display: block; padding: 0 10px"> 'doc' => 'application/msword',
</span><span class="cx" style="display: block; padding: 0 10px"> 'word' => 'application/msword',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
+ 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
+ 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template',
+ 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
+ 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
+ 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide',
+ 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
+ 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
+ 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12',
+ 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'class' => 'application/octet-stream',
</span><span class="cx" style="display: block; padding: 0 10px"> 'dll' => 'application/octet-stream',
</span><span class="cx" style="display: block; padding: 0 10px"> 'dms' => 'application/octet-stream',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3348,7 +3547,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return preg_replace('/(\r\n|\r|\n)/ms', $breaktype, $text);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Set the public and private key files and password for S/MIME signing.
</span><span class="cx" style="display: block; padding: 0 10px"> * @access public
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3517,7 +3715,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> "\tbh=" . $DKIMb64 . ";\r\n" .
</span><span class="cx" style="display: block; padding: 0 10px"> "\tb=";
</span><span class="cx" style="display: block; padding: 0 10px"> $toSign = $this->DKIM_HeaderC(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $from_header . "\r\n" . $to_header . "\r\n" . $subject_header . "\r\n" . $dkimhdrs
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $from_header . "\r\n" .
+ $to_header . "\r\n" .
+ $subject_header . "\r\n" .
+ $dkimhdrs
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $signed = $this->DKIM_Sign($toSign);
</span><span class="cx" style="display: block; padding: 0 10px"> return $dkimhdrs . $signed . "\r\n";
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3537,6 +3738,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Allows for public read access to 'to' property.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @access public
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3547,6 +3749,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Allows for public read access to 'cc' property.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @access public
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3557,6 +3760,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Allows for public read access to 'bcc' property.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @access public
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3567,6 +3771,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Allows for public read access to 'ReplyTo' property.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @access public
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3577,6 +3782,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Allows for public read access to 'all_recipients' property.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @access public
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span></span></pre></div>
<a id="trunksrcwpincludesclasssmtpphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-smtp.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-smtp.php 2015-12-24 00:25:06 UTC (rev 36082)
+++ trunk/src/wp-includes/class-smtp.php 2015-12-24 01:58:33 UTC (rev 36083)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -28,25 +28,25 @@
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The PHPMailer SMTP version number.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- const VERSION = '5.2.10';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ const VERSION = '5.2.14';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * SMTP line break constant.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> const CRLF = "\r\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The SMTP port to use if one is not specified.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type integer
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var integer
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> const DEFAULT_SMTP_PORT = 25;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The maximum line length allowed by RFC 2822 section 2.1.1
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type integer
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var integer
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> const MAX_LINE_LENGTH = 998;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -77,15 +77,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The PHPMailer SMTP Version number.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @deprecated Use the `VERSION` constant instead
</span><span class="cx" style="display: block; padding: 0 10px"> * @see SMTP::VERSION
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public $Version = '5.2.10';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public $Version = '5.2.14';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * SMTP server port number.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type integer
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var integer
</ins><span class="cx" style="display: block; padding: 0 10px"> * @deprecated This is only ever used as a default value, so use the `DEFAULT_SMTP_PORT` constant instead
</span><span class="cx" style="display: block; padding: 0 10px"> * @see SMTP::DEFAULT_SMTP_PORT
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -93,7 +93,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * SMTP reply line ending.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @deprecated Use the `CRLF` constant instead
</span><span class="cx" style="display: block; padding: 0 10px"> * @see SMTP::CRLF
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -107,7 +107,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * * self::DEBUG_SERVER (`2`) Client commands and server responses
</span><span class="cx" style="display: block; padding: 0 10px"> * * self::DEBUG_CONNECTION (`3`) As DEBUG_SERVER plus connection status
</span><span class="cx" style="display: block; padding: 0 10px"> * * self::DEBUG_LOWLEVEL (`4`) Low-level data output, all messages
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type integer
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var integer
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $do_debug = self::DEBUG_OFF;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -122,7 +122,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * <code>
</span><span class="cx" style="display: block; padding: 0 10px"> * $smtp->Debugoutput = function($str, $level) {echo "debug level $level; message: $str";};
</span><span class="cx" style="display: block; padding: 0 10px"> * </code>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string|callable
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string|callable
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $Debugoutput = 'echo';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -130,7 +130,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Whether to use VERP.
</span><span class="cx" style="display: block; padding: 0 10px"> * @link http://en.wikipedia.org/wiki/Variable_envelope_return_path
</span><span class="cx" style="display: block; padding: 0 10px"> * @link http://www.postfix.org/VERP_README.html Info on VERP
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type boolean
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var boolean
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $do_verp = false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -139,26 +139,26 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2
</span><span class="cx" style="display: block; padding: 0 10px"> * This needs to be quite high to function correctly with hosts using greetdelay as an anti-spam measure.
</span><span class="cx" style="display: block; padding: 0 10px"> * @link http://tools.ietf.org/html/rfc2821#section-4.5.3.2
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type integer
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var integer
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $Timeout = 300;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * How long to wait for commands to complete, in seconds.
</span><span class="cx" style="display: block; padding: 0 10px"> * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type integer
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var integer
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $Timelimit = 300;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The socket for the server connection.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type resource
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var resource
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $smtp_conn;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Error information, if any, for the last SMTP command.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var array
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $error = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'error' => '',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -170,7 +170,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The reply the server sent to us for HELO.
</span><span class="cx" style="display: block; padding: 0 10px"> * If null, no HELO string has yet been received.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string|null
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string|null
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $helo_rply = null;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -181,13 +181,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * represents the server name. In case of HELO it is the only element of the array.
</span><span class="cx" style="display: block; padding: 0 10px"> * Other values can be boolean TRUE or an array containing extension options.
</span><span class="cx" style="display: block; padding: 0 10px"> * If null, no HELO/EHLO string has yet been received.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type array|null
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var array|null
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $server_caps = null;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The most recent reply received from the server.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $last_reply = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -351,20 +351,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Perform SMTP authentication.
</span><span class="cx" style="display: block; padding: 0 10px"> * Must be run after hello().
</span><span class="cx" style="display: block; padding: 0 10px"> * @see hello()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $username The user name
- * @param string $password The password
- * @param string $authtype The auth type (PLAIN, LOGIN, NTLM, CRAM-MD5)
- * @param string $realm The auth realm for NTLM
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $username The user name
+ * @param string $password The password
+ * @param string $authtype The auth type (PLAIN, LOGIN, NTLM, CRAM-MD5, XOAUTH2)
+ * @param string $realm The auth realm for NTLM
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $workstation The auth workstation for NTLM
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @access public
- * @return boolean True if successfully authenticated.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param null|OAuth $OAuth An optional OAuth instance (@see PHPMailerOAuth)
+ * @return bool True if successfully authenticated.* @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function authenticate(
</span><span class="cx" style="display: block; padding: 0 10px"> $username,
</span><span class="cx" style="display: block; padding: 0 10px"> $password,
</span><span class="cx" style="display: block; padding: 0 10px"> $authtype = null,
</span><span class="cx" style="display: block; padding: 0 10px"> $realm = '',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $workstation = ''
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $workstation = '',
+ $OAuth = null
</ins><span class="cx" style="display: block; padding: 0 10px"> ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if (!$this->server_caps) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->setError('Authentication is not allowed before HELO/EHLO');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -673,9 +674,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->server_caps = array();
</span><span class="cx" style="display: block; padding: 0 10px"> $lines = explode("\n", $this->last_reply);
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ($lines as $n => $s) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ //First 4 chars contain response code followed by - or space
</ins><span class="cx" style="display: block; padding: 0 10px"> $s = trim(substr($s, 4));
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (!$s) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (empty($s)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $fields = explode(' ', $s);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -685,11 +688,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $fields = $fields[0];
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $name = array_shift($fields);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ($name == 'SIZE') {
- $fields = ($fields) ? $fields[0] : 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ switch ($name) {
+ case 'SIZE':
+ $fields = ($fields ? $fields[0] : 0);
+ break;
+ case 'AUTH':
+ if (!is_array($fields)) {
+ $fields = array();
+ }
+ break;
+ default:
+ $fields = true;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->server_caps[$name] = ($fields ? $fields : true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->server_caps[$name] = $fields;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -739,15 +751,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Sets the TO argument to $toaddr.
</span><span class="cx" style="display: block; padding: 0 10px"> * Returns true if the recipient was accepted false if it was rejected.
</span><span class="cx" style="display: block; padding: 0 10px"> * Implements from rfc 821: RCPT <SP> TO:<forward-path> <CRLF>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $toaddr The address the message is being sent to
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $address The address the message is being sent to
</ins><span class="cx" style="display: block; padding: 0 10px"> * @access public
</span><span class="cx" style="display: block; padding: 0 10px"> * @return boolean
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function recipient($toaddr)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function recipient($address)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->sendCommand(
</span><span class="cx" style="display: block; padding: 0 10px"> 'RCPT TO',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'RCPT TO:<' . $toaddr . '>',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'RCPT TO:<' . $address . '>',
</ins><span class="cx" style="display: block; padding: 0 10px"> array(250, 251)
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -766,9 +778,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Send a command to an SMTP server and check its return code.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $command The command name - not sent to the server
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $command The command name - not sent to the server
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $commandstring The actual command to send
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param integer|array $expect One or more expected integer success codes
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param integer|array $expect One or more expected integer success codes
</ins><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</span><span class="cx" style="display: block; padding: 0 10px"> * @return boolean True on success.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -778,6 +790,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->setError("Called $command without being connected");
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ //Reject line breaks in all commands
+ if (strpos($commandstring, "\n") !== false or strpos($commandstring, "\r") !== false) {
+ $this->setError("Command '$command' contained line breaks");
+ return false;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->client_send($commandstring . self::CRLF);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->last_reply = $this->get_lines();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -981,10 +998,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> while (is_resource($this->smtp_conn) && !feof($this->smtp_conn)) {
</span><span class="cx" style="display: block; padding: 0 10px"> $str = @fgets($this->smtp_conn, 515);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->edebug("SMTP -> get_lines(): \$data was \"$data\"", self::DEBUG_LOWLEVEL);
- $this->edebug("SMTP -> get_lines(): \$str is \"$str\"", self::DEBUG_LOWLEVEL);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->edebug("SMTP -> get_lines(): \$data is \"$data\"", self::DEBUG_LOWLEVEL);
+ $this->edebug("SMTP -> get_lines(): \$str is \"$str\"", self::DEBUG_LOWLEVEL);
</ins><span class="cx" style="display: block; padding: 0 10px"> $data .= $str;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->edebug("SMTP -> get_lines(): \$data is \"$data\"", self::DEBUG_LOWLEVEL);
</del><span class="cx" style="display: block; padding: 0 10px"> // If 4th character is a space, we are done reading, break the loop, micro-optimisation over strlen
</span><span class="cx" style="display: block; padding: 0 10px"> if ((isset($str[3]) and $str[3] == ' ')) {
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span></span></pre>
</div>
</div>
</body>
</html>