public function createMessageId()
{
$time = time();
if ($this->_from !== null) {
$user = $this->_from;
} elseif (isset($_SERVER['REMOTE_ADDR'])) {
$user = $_SERVER['REMOTE_ADDR'];
} else {
$user = getmypid();
}
$rand = mt_rand();
if ($this->_recipients !== array()) {
$recipient = array_rand($this->_recipients);
} else {
$recipient = 'unknown';
}
if (isset($_SERVER["SERVER_NAME"])) {
$hostName = $_SERVER["SERVER_NAME"];
} else {
$hostName = php_uname('n');
}
return sha1($time . $user . $rand . $recipient) . '@' . $hostName;
}