php PHP Mailer WP

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php PHP Mailer 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 = "";
		$phpmailer->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 PHP Mailer WP的主要内容,如果未能解决你的问题,请参考以下文章