SMTP_Mailer
in package
Set use of SMTP mail.
Initialises phpmailer to use SMTP and specifies the host connection parameters. The following constants MUST be defined in wp-config.php:
- SMTP_HOST The hostname of the mail server.
- SMTP_PORT SMTP port number - likely to be 25, 465 or 587.
- SMTP_SECURE Encryption system to use - ssl or tls.
- SMTP_AUTH Use SMTP authentication (true|false).
- SMTP_DEBUG Set to 1 or 2 for debugging purposes only.
- SMTP_DEBUG_OUTPUT Set to error_log to place debug ouptut into standard log file.
Tags
Table of Contents
Properties
- $instances : array<string|int, object>
- The array of instances of this class and sub-classes.
- $smtp_from : string
- SMTP sender.
- $smtp_from_name : string
- SMTP sender name.
- $smtp_password : string
- SMTP user password.
- $smtp_user : string
- SMTP user name.
Methods
- get_instance() : object
- Creates and/or returns the instance of this class.
- set_smtp() : void
- Connect wp_mail to the SMTP server.
- __construct() : void
- Initialise the class.
Properties
$instances
The array of instances of this class and sub-classes.
protected
static array<string|int, object>
$instances
= array()
Tags
$smtp_from
SMTP sender.
protected
string
$smtp_from
= ''
Tags
$smtp_from_name
SMTP sender name.
protected
string
$smtp_from_name
= ''
Tags
$smtp_password
SMTP user password.
protected
string
$smtp_password
= ''
Tags
$smtp_user
SMTP user name.
protected
string
$smtp_user
= ''
Tags
Methods
get_instance()
Creates and/or returns the instance of this class.
public
static get_instance() : object
Tags
Return values
object —The instance of this class.
set_smtp()
Connect wp_mail to the SMTP server.
public
set_smtp(PHPMailer $phpmailer) : void
Parameters
- $phpmailer : PHPMailer
-
The PHPMailer instance (passed by reference).
Tags
__construct()
Initialise the class.
protected
__construct() : void