getLastMessageID() public method

Technically this is the value from the last time the headers were created, but it's also the message ID of the last sent message except in pathological cases.
public getLastMessageID ( ) : string
return string
コード例 #1
0
 /**
  * Test setting and retrieving message ID.
  */
 public function testMessageID()
 {
     $this->Mail->Body = 'Test message ID.';
     $id = md5(12345);
     $this->Mail->MessageID = $id;
     $this->buildBody();
     $this->Mail->preSend();
     $lastid = $this->Mail->getLastMessageID();
     $this->assertEquals($lastid, $id, 'Custom Message ID mismatch');
 }
コード例 #2
0
ファイル: phpmailerTest.php プロジェクト: jbs321/portfolio
 /**
  * Test setting and retrieving message ID.
  */
 public function testMessageID()
 {
     $this->Mail->Body = 'Test message ID.';
     $id = md5(12345);
     $this->Mail->MessageID = $id;
     $this->buildBody();
     $this->Mail->preSend();
     $lastid = $this->Mail->getLastMessageID();
     $this->assertNotEquals($lastid, $id, 'Invalid Message ID allowed');
     $id = '<' . md5(12345) . '@example.com>';
     $this->Mail->MessageID = $id;
     $this->buildBody();
     $this->Mail->preSend();
     $lastid = $this->Mail->getLastMessageID();
     $this->assertEquals($lastid, $id, 'Custom Message ID not used');
     $this->Mail->MessageID = '';
     $this->buildBody();
     $this->Mail->preSend();
     $lastid = $this->Mail->getLastMessageID();
     $this->assertRegExp('/^<.*@.*>$/', $lastid, 'Invalid default Message ID');
 }