PHPMailer Class Bug Fix!

Posted on April 2, 2007
Filed Under Design |

PHPMailer e-mail class is likely one of the most popular e-mail classes in use on the web today. Written by Brent R. Matzelle, many open source projects use the phpmailer class because of its clean structure and ease of use.

Recently an associate of mine discovered that errors can be produced when the class is used in applications which feature a CC or BCC for emailing and subsequently modified the code to accommodate a solution. Now since this class is used in things like Joomla and other products I tend to favor, I figured I’d publish a copy here for your use. You can find the original PHPMailer on the source forge site.

What has been modified is between lines 786 - 796 of the code.
//Modifications Begin Here
// sendmail and mail() extract Cc from the header before sending
if((($this->Mailer == “sendmail”) || ($this->Mailer == “mail”)) && (count($this->cc) > 0))
$result .= $this->AddrAppend(”Cc”, $this->cc);
// sendmail and mail() extract Bcc from the header before sending
if((($this->Mailer == “sendmail”) || ($this->Mailer == “mail”)) && (count($this->bcc) > 0))
$result .= $this->AddrAppend(”Bcc”, $this->bcc);

if(count($this->ReplyTo) > 0)
$result .= $this->AddrAppend(”Reply-to”, $this->ReplyTo);
//End Modifications

You can download the entire modified script here class.phpmailer.fixed.zip

Comments

Leave a Comment

If you would like to make a comment, please fill out the form below.

Name (required)

Email (required)

Website

Comments


TEMP CODE: GDHXCDX17249629
Close
E-mail It