eef62a9d0d
Includes two trivial modifications for WordPress: * Doesn't use the autoloader, so the check to enforce the autoloader from the constructor is removed. * Requires class-smtp.php for backwards compatibility with direct (non-wp_mail()) uses of PHPMailer, as the autoloader isn't used. props bpetty. fixes #25560. git-svn-id: https://develop.svn.wordpress.org/trunk@27385 602fd350-edb4-49c9-b593-d223f7449a82
29 lines
539 B
PHP
29 lines
539 B
PHP
<?php
|
|
require_once( ABSPATH . '/wp-includes/class-phpmailer.php' );
|
|
|
|
class MockPHPMailer extends PHPMailer {
|
|
var $mock_sent = array();
|
|
|
|
/**
|
|
* Override send() so mail isn't actually sent.
|
|
*/
|
|
function send() {
|
|
try {
|
|
if ( ! $this->preSend() )
|
|
return false;
|
|
|
|
$this->mock_sent[] = array(
|
|
'to' => $this->to,
|
|
'cc' => $this->cc,
|
|
'bcc' => $this->bcc,
|
|
'header' => $this->MIMEHeader,
|
|
'body' => $this->MIMEBody,
|
|
);
|
|
|
|
return true;
|
|
} catch ( phpmailerException $e ) {
|
|
return false;
|
|
}
|
|
}
|
|
}
|