0
0
mirror of https://github.com/PHPMailer/PHPMailer.git synced 2024-09-20 10:02:14 +02:00

Merge changes from #101

This commit is contained in:
Synchro 2013-08-30 13:28:49 +02:00
parent e16c820e56
commit 4075ba4b6b

View File

@ -479,6 +479,13 @@ class PHPMailer
*/ */
protected $CustomHeader = array(); protected $CustomHeader = array();
/**
* The most recent Message-ID (including angular brackets).
* @type string
* @access protected
*/
protected $lastMessageID = '';
/** /**
* The message's MIME type. * The message's MIME type.
* @type string * @type string
@ -806,6 +813,18 @@ class PHPMailer
return true; return true;
} }
/**
* Return the Message-ID header of the last email.
* Technically this is the value from the last time the headers were created,
* but it also the message ID of the last sent message except in
* pathological cases.
* @return string
*/
public function GetLastMessageID()
{
return $this->lastMessageID;
}
/** /**
* Check that a string looks like an email address. * Check that a string looks like an email address.
* @param string $address The email address to check * @param string $address The email address to check
@ -1606,10 +1625,11 @@ class PHPMailer
} }
if ($this->MessageID != '') { if ($this->MessageID != '') {
$result .= $this->headerLine('Message-ID', $this->MessageID); $this->lastMessageID = $this->MessageID;
} else { } else {
$result .= sprintf("Message-ID: <%s@%s>%s", $uniq_id, $this->serverHostname(), $this->LE); $this->lastMessageID = sprintf("<%s@%s>", $uniq_id, $this->ServerHostname());
} }
$result .= $this->HeaderLine('Message-ID', $this->lastMessageID);
$result .= $this->headerLine('X-Priority', $this->Priority); $result .= $this->headerLine('X-Priority', $this->Priority);
if ($this->XMailer == '') { if ($this->XMailer == '') {
$result .= $this->headerLine( $result .= $this->headerLine(
@ -2914,7 +2934,7 @@ class PHPMailer
'avi' => 'video/x-msvideo', 'avi' => 'video/x-msvideo',
'movie' => 'video/x-sgi-movie' 'movie' => 'video/x-sgi-movie'
); );
return (!isset($mimes[strtolower($ext)])) ? 'application/octet-stream' : $mimes[strtolower($ext)]; return (array_key_exists(strtolower($ext), $mimes) ? $mimes[strtolower($ext)]: 'application/octet-stream');
} }
/** /**