id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,focuses 33972,static use of PHPMailer class results in stale state between calls to wp_mail(),codebuddy,,"I've just been chasing down a problem since upgrading to WordPress 4.3 with mails sent via wp_mail() being sent with: Content-Transfer-Encoding: quoted-printable Auto switching to quoted-printable was added in the PHPMailer class which was upgraded in 4.3. The issue is that the internal state in $phpmailer is not properly cleared between calls to wp_mail(). There is an attempt to do this via: // Empty out the values that may be set $phpmailer->ClearAllRecipients(); $phpmailer->ClearAttachments(); $phpmailer->ClearCustomHeaders(); $phpmailer->ClearReplyTos(); But non of these methods reset the value of $this->Encoding. So if I make two calls to wp_mail() and the first one gets switched to quoted-printable the second one will be sent as quoted-printable even if it doesn't need to be. Would it not be better to just create a new instance of PHPMailer for each invocation of wp_mail() and let the constructor take care of it? ",defect (bug),new,normal,,Mail,4.3,normal,,needs-patch,,