php Configurar SMTP WP

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php Configurar SMTP WP相关的知识,希望对你有一定的参考价值。

<?php 
/**
 * This function will connect wp_mail to your authenticated
 * SMTP server. This improves reliability of wp_mail, and
 * avoids many potential problems.
 */
function send_smtp_email($phpmailer) {
	$phpmailer->isSMTP();
	$phpmailer->isHTML(true);
	$phpmailer->Host = "smtp.gmail.com";
	$phpmailer->SMTPAuth = true; // uncomment for gmail
	$phpmailer->Port = 587;
	$phpmailer->Username = "<USERNAME>";
	$phpmailer->Password = "<PASSWORD>";
	$phpmailer->SMTPSecure = "tls"; // uncomment for gmail
    //$phpmailer->From = FROM;
    //$phpmailer->FromName = FROMNAME;
    //$phpmailer->SMTPDebug  = 2; // uncomment for full debug
}

add_action( 'phpmailer_init', 'send_smtp_email' );

以上是关于php Configurar SMTP WP的主要内容,如果未能解决你的问题,请参考以下文章

php wp-config中的WP Mail SMTP插件配置

php WP Mail SMTP:使用SMTP邮件程序时 - 在PHP 5.6+上禁用SSL验证

php WP Mail SMTP:禁用SMTPAutoTLS

php SMTP使用wp-config.php进行设置

php SMTP使用wp-config.php进行设置

php SMTP使用wp-config.php进行设置