WordPress Trac: Ticket #15912: PHP Mailer Upgradehttps://core.trac.wordpress.org/ticket/15912
<p>
With WordPress 3.2, PHP 5 will become a requirement.
</p>
<p>
PHPMailer should therefore be updated to the code specific for PHP5 rather than the current 2.0.4 version which is for PHP4.
</p>
en-usWordPress Trachttps://core.trac.wordpress.org/chrome/site/your_project_logo.pnghttps://core.trac.wordpress.org/ticket/15912
Trac 1.0.1nacinMon, 20 Dec 2010 12:27:59 GMTkeywords, component, milestone changedhttps://core.trac.wordpress.org/ticket/15912#comment:1
https://core.trac.wordpress.org/ticket/15912#comment:1
<ul>
<li><strong>keywords</strong>
<em>3.2-early</em> added; <em>PHPMailer</em> removed
</li>
<li><strong>component</strong>
changed from <em>Mail</em> to <em>External Libraries</em>
</li>
<li><strong>milestone</strong>
changed from <em>Awaiting Review</em> to <em>Future Release</em>
</li>
</ul>
Ticketcnorris23Mon, 28 Mar 2011 00:22:10 GMTkeywords changedhttps://core.trac.wordpress.org/ticket/15912#comment:2
https://core.trac.wordpress.org/ticket/15912#comment:2
<ul>
<li><strong>keywords</strong>
<em>has-patch</em> <em>needs-testing</em> added
</li>
</ul>
<p>
Update to PHPMailer to version 5.1. FWIW, I've been using 5.1 on a BuddyPress site since late-2.9.x/3.0 with no problems (that I've noticed).
</p>
Ticketcnorris23Mon, 28 Mar 2011 00:22:37 GMTattachment sethttps://core.trac.wordpress.org/ticket/15912
https://core.trac.wordpress.org/ticket/15912
<ul>
<li><strong>attachment</strong>
set to <em>15912.001.diff</em>
</li>
</ul>
TicketMattyRobMon, 28 Mar 2011 08:37:03 GMThttps://core.trac.wordpress.org/ticket/15912#comment:3
https://core.trac.wordpress.org/ticket/15912#comment:3
<p>
I'm not sure if this needs another ticket or if it can be done here but while we are updating class-phpmailer.php should we update class-pop3.php from the same source too?
</p>
<p>
I'll try to get a patch upload from home later today that does this.
</p>
TicketMattyRobMon, 28 Mar 2011 19:17:54 GMThttps://core.trac.wordpress.org/ticket/15912#comment:4
https://core.trac.wordpress.org/ticket/15912#comment:4
<p>
Patch for class-pop3.php and class-phpmailer.php
</p>
TicketaaroncampbellMon, 28 Mar 2011 21:37:20 GMThttps://core.trac.wordpress.org/ticket/15912#comment:5
https://core.trac.wordpress.org/ticket/15912#comment:5
<p>
Replying to <a class="closed" href="https://core.trac.wordpress.org/ticket/15912#comment:3" title="Comment 3 for Ticket #15912">MattyRob</a>:
</p>
<blockquote class="citation">
<p>
I'm not sure if this needs another ticket or if it can be done here but while we are updating class-phpmailer.php should we update class-pop3.php from the same source too?
</p>
</blockquote>
<p>
Yes it should, but I think it does. The 001 patch looks to me like it patches class-phpmailer.php, class-pop3.php and class-smtp.php (which should all upgrade together).
</p>
<p>
The new 002 patch, however, seems to be missing the class-smtp.php file.
</p>
TicketMattyRobTue, 29 Mar 2011 07:23:54 GMThttps://core.trac.wordpress.org/ticket/15912#comment:6
https://core.trac.wordpress.org/ticket/15912#comment:6
<p>
@aaroncampbell,
</p>
<p>
Sorry my mistake, I should have said only class-phpmailer.php and class-smtp.php because the current class-pop3.php file is from the SquirrelMail package, not PHPMailer.
</p>
<p>
I'll have another go at the patch later to only replace the class-phpmailer.php and class-smtp.php files.
</p>
TicketMattyRobTue, 29 Mar 2011 11:25:06 GMThttps://core.trac.wordpress.org/ticket/15912#comment:7
https://core.trac.wordpress.org/ticket/15912#comment:7
<p>
I'll get a patch uploaded later but the phpmailer class needs a small amend on line 702. Here the phpmailer class calls the SMTP class but because WordPress changes the file names it falls over.
</p>
<p>
So, either WordPress needs to use the original filenames or we need to check and make sue they are changes to the WordPress equivalents within the files.
</p>
Ticketcnorris23Tue, 29 Mar 2011 15:05:56 GMThttps://core.trac.wordpress.org/ticket/15912#comment:8
https://core.trac.wordpress.org/ticket/15912#comment:8
<p>
@MattyRob The patch is correct. The pop3 class is what's included with the PHPMailer 5.1 download. They're doing what WP is doing and using external libraries. As far as changing the file name for include, that isn't needed. WP handles this on it's own.
</p>
TicketwestiTue, 29 Mar 2011 15:12:30 GMTkeywords changedhttps://core.trac.wordpress.org/ticket/15912#comment:9
https://core.trac.wordpress.org/ticket/15912#comment:9
<ul>
<li><strong>keywords</strong>
<em>has-patch</em> removed
</li>
</ul>
<p>
class-pop3.php is not from PHPMailer so please don't touch it in any patches.
</p>
<p>
This comes from SquirrelMail and says so clearly in it's headers - it is not to be changed and is used by the core post-by-email code which is not in active support - we just haven't ripped it out yet because there isn't a drop-in replacement plugin we can recommend at the moment.
</p>
TicketMattyRobTue, 29 Mar 2011 17:38:53 GMTkeywords changedhttps://core.trac.wordpress.org/ticket/15912#comment:10
https://core.trac.wordpress.org/ticket/15912#comment:10
<ul>
<li><strong>keywords</strong>
<em>has-patch</em> added; <em>needs-testing</em> removed
</li>
</ul>
<p>
Okay, updated patch attached now that replaces the phpmailer and smtp files, renames them to the WordPress current naming convention and fixes the include statement in the phpmailer class that calls the smtp file. I've tested this with a custom PHPMailer filter plugin that forces emails through SMTP and it works. for me on a 3.1 installation.
</p>
TicketMattyRobTue, 29 Mar 2011 17:39:26 GMTattachment sethttps://core.trac.wordpress.org/ticket/15912
https://core.trac.wordpress.org/ticket/15912
<ul>
<li><strong>attachment</strong>
set to <em>15912.002.diff</em>
</li>
</ul>
TicketaaroncampbellWed, 06 Apr 2011 16:56:09 GMThttps://core.trac.wordpress.org/ticket/15912#comment:11
https://core.trac.wordpress.org/ticket/15912#comment:11
<p>
Regarding the SquirrelMail POP3 class, see <a class="closed ticket" href="https://core.trac.wordpress.org/ticket/17064" title="defect (bug): Upgrade SquirrelMail POP3 class (closed: fixed)">#17064</a>
</p>
TicketryanThu, 21 Apr 2011 20:29:32 GMTstatus changed; resolution sethttps://core.trac.wordpress.org/ticket/15912#comment:12
https://core.trac.wordpress.org/ticket/15912#comment:12
<ul>
<li><strong>status</strong>
changed from <em>new</em> to <em>closed</em>
</li>
<li><strong>resolution</strong>
set to <em>fixed</em>
</li>
</ul>
<p>
(In <a class="changeset" href="https://core.trac.wordpress.org/changeset/17676" title="Update phpmailer and smtp to 5.1. Props MattyRob cnorris23. fixes #15912">[17676]</a>) Update phpmailer and smtp to 5.1. Props MattyRob cnorris23. fixes <a class="closed ticket" href="https://core.trac.wordpress.org/ticket/15912" title="defect (bug): PHP Mailer Upgrade (closed: fixed)">#15912</a>
</p>
TicketryanThu, 21 Apr 2011 20:31:59 GMTmilestone changedhttps://core.trac.wordpress.org/ticket/15912#comment:13
https://core.trac.wordpress.org/ticket/15912#comment:13
<ul>
<li><strong>milestone</strong>
changed from <em>Future Release</em> to <em>3.2</em>
</li>
</ul>
Ticket