- $hdrs .= "Content-Type: multipart/mixed; boundary=\"$boundary\";\n";
- $hdrs .= "Content-Transfer-Encoding: 7bit\n";
- $mtxt .= "This part of the E-mail should never be seen. If\n";
- $mtxt .= "you are reading this, consider upgrading your e-mail\n";
- $mtxt .= "client to a MIME-compatible client.\n";
- $mtxt .= "\n--$boundary\n";
- if (ereg("text/.*", $this->content_type)) {
- $mtxt .= "Content-Type: ".$this->content_type."; charset=\"".$this->charset."\"\n";
+ $hdrs .= 'Content-Type: multipart/mixed; boundary="'.$boundary.'";'."\n";
+ $hdrs .= 'Content-Transfer-Encoding: 7bit'."\n";
+ $mtxt .= 'This part of the E-mail should never be seen. If'."\n";
+ $mtxt .= 'you are reading this, consider upgrading your e-mail'."\n";
+ $mtxt .= 'client to a MIME-compatible client.'."\n";
+ $mtxt .= "\n".'--'.$boundary."\n";
+ if (preg_match('|^text/|', $this->content_type)) {
+ $mtxt .= 'Content-Type: '.$this->content_type.'; charset="'.$this->charset.'"'."\n";