- $boundary = "KaiRoJVPSteyr1030713";
- $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 .= "--$boundary\n";
- if (ereg("text/.*", $this->content_type)) {
- $mtxt .= "Content-Type: ".$this->content_type."; charset=\"".$this->charset."\"\n";
+ // create random boundary, 20 chars, always beginning with KaiRo ;-)
+ $boundary = 'KaiRo';
+ for ($i = 1; $i <= 15; $i++) {
+ $r = rand(0, 61);
+ if ($r < 10) { $boundary .= chr($r + 48); }
+ elseif ($r < 36) { $boundary .= chr($r + 55); }
+ elseif ($r < 62) { $boundary .= chr($r + 61); }
+ }
+ $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";