Zend_Mail::createMessageId PHP Method

createMessageId() public method

Creates the Message-ID
public createMessageId ( ) : string
return string
    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;
    }