Fires after PHPMailer is initialized.
Parameters
$phpmailerPHPMailer- 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.
$phpmailerPHPMailerdo_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 theSenderheader. The parameter defaults totrue, and using that can cause messages to be rejected.See #37736 for details.