Fires after PHPMailer is initialized.
Parameters
$phpmailer
PHPMailer- The PHPMailer instance (passed by reference).
Source
do_action_ref_array( 'phpmailer_init', array( &$phpmailer ) );
Changelog
Version | Description |
---|---|
2.2.0 | Introduced. |
Fires after PHPMailer is initialized.
$phpmailer
PHPMailerdo_action_ref_array( 'phpmailer_init', array( &$phpmailer ) );
Version | Description |
---|---|
2.2.0 | Introduced. |
You must log in before being able to contribute a note or feedback.
Example migrated from Codex:
This is an example of establishing an SMTP connection using the `
phpmailer_init
` action:If you call
$phpmailer->setFrom()
, it’s often important to explicitly set the third parameter tofalse
, to tell PHPMailer to not override theSender
header. The parameter defaults totrue
, and using that can cause messages to be rejected.See #37736 for details.