ability to create custom message IDs and boundaries (#877)

This commit is contained in:
1stborn 2016-11-09 16:56:39 +02:00 committed by Marcus Bointon
parent af59766173
commit f92b368446
1 changed files with 9 additions and 1 deletions

View File

@ -2127,6 +2127,14 @@ class PHPMailer
return rtrim($this->MIMEHeader . $this->mailHeader, "\n\r") . self::CRLF . self::CRLF . $this->MIMEBody;
}
/**
* Create unique ID
* @return string
*/
protected function generateId() {
return md5(uniqid(time()));
}
/**
* Assemble the message body.
* Returns an empty string on failure.
@ -2138,7 +2146,7 @@ class PHPMailer
{
$body = '';
//Create unique IDs and preset boundaries
$this->uniqueid = md5(uniqid(time()));
$this->uniqueid = $this->generateId();
$this->boundary[1] = 'b1_' . $this->uniqueid;
$this->boundary[2] = 'b2_' . $this->uniqueid;
$this->boundary[3] = 'b3_' . $this->uniqueid;