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

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php WP Mail SMTP:使用SMTP邮件程序时 - 在PHP 5.6+上禁用SSL验证相关的知识,希望对你有一定的参考价值。

<?php

add_filter('wp_mail_smtp_custom_options', function( $phpmailer ) {
    $phpmailer->SMTPOptions = array(
		'ssl' => array(
			'verify_peer'       => false,
			'verify_peer_name'  => false,
			'allow_self_signed' => true
		)
	);
	
    return $phpmailer;
} );

以上是关于php WP Mail SMTP:使用SMTP邮件程序时 - 在PHP 5.6+上禁用SSL验证的主要内容,如果未能解决你的问题,请参考以下文章

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

wordpress | WP Mail SMTP使用QQ邮箱发布失败的解决办法

php使用phpmailer类和smtp发送邮件

PHP通过SMTP实现发送邮件_包括附件

如何使用php的mail函数

php使用smtp类发送邮件