2013-08-07 08:38:38 +02:00
|
|
|
<?php
|
|
|
|
require_once( ABSPATH . '/wp-includes/class-phpmailer.php' );
|
|
|
|
|
|
|
|
class MockPHPMailer extends PHPMailer {
|
|
|
|
var $mock_sent = array();
|
|
|
|
|
2015-07-08 19:15:02 +02:00
|
|
|
function preSend() {
|
|
|
|
$this->Encoding = '8bit';
|
|
|
|
return parent::preSend();
|
|
|
|
}
|
|
|
|
|
2014-03-03 21:24:31 +01:00
|
|
|
/**
|
2015-07-08 19:15:02 +02:00
|
|
|
* Override postSend() so mail isn't actually sent.
|
2014-03-03 21:24:31 +01:00
|
|
|
*/
|
2015-07-08 19:15:02 +02:00
|
|
|
function postSend() {
|
|
|
|
$this->mock_sent[] = array(
|
|
|
|
'to' => $this->to,
|
|
|
|
'cc' => $this->cc,
|
|
|
|
'bcc' => $this->bcc,
|
|
|
|
'header' => $this->MIMEHeader,
|
|
|
|
'body' => $this->MIMEBody,
|
|
|
|
);
|
2013-08-07 08:38:38 +02:00
|
|
|
|
2015-07-08 19:15:02 +02:00
|
|
|
return true;
|
2013-08-07 08:38:38 +02:00
|
|
|
}
|
|
|
|
}
|