phpmailer_init
最后更新于:2021-11-27 14:13:23
do_action_ref_array( ‘phpmailer_init’, PHPMailer $phpmailer )
Fires after PHPMailer is initialized.
参数
- $phpmailer
-
(PHPMailer)
The PHPMailer instance (passed by reference).
源文件
文件: gc-includes/pluggable.php
function my_phpmailer_example( $phpmailer ) { $phpmailer->isSMTP(); $phpmailer->Host = 'smtp.example.com'; $phpmailer->SMTPAuth = true; // Ask it to use authenticate using the Username and Password properties $phpmailer->Port = 25; $phpmailer->Username = 'yourusername'; $phpmailer->Password = 'yourpassword'; // Additional settings… //$phpmailer->SMTPSecure = 'tls'; // Choose 'ssl' for SMTPS on port 465, or 'tls' for SMTP+STARTTLS on port 25 or 587 //$phpmailer->From = "you@yourdomail.com"; //$phpmailer->FromName = "Your Name"; } add_action( 'phpmailer_init', 'my_phpmailer_example' );