第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

通過(guò) PHPMailer 的 WooComerce SMTP

通過(guò) PHPMailer 的 WooComerce SMTP

PHP
Cats萌萌 2023-10-15 15:43:02
我通過(guò)functions.php 設(shè)置了一個(gè)wordpress 站點(diǎn),以將SMTP 與PHPMailer 結(jié)合使用(下面的代碼片段)。add_action( 'phpmailer_init', 'setup_phpmailer_init' );function setup_phpmailer_init( PHPMailer $phpmailer ) {    $phpmailer->Host = 'HOSTNAME'; // for example, smtp.mailtrap.io    $phpmailer->Port = 587; // set the appropriate port: 465, 2525, etc.    $phpmailer->Username = 'YOURUSERNAME'; // your SMTP username    $phpmailer->Password = 'YOURPASSWORD'; // your SMTP password    $phpmailer->SMTPAuth = true;     $phpmailer->SMTPSecure = 'tls'; // preferable but optional    $phpmailer->IsSMTP();除了 WooCommerce 之外,這對(duì)所有內(nèi)容都沒(méi)有問(wèn)題。WooCommerce 無(wú)法發(fā)送電子郵件,并出現(xiàn)以下錯(cuò)誤:2020-08-18T00:36:33+00:00 CRITICAL Uncaught TypeError: Argument 1 passed to setup_phpmailer_init() must be an instance of PHPMailer, instance of PHPMailer\PHPMailer\PHPMailer given, called in PathToWordpress/web/wp/wp-includes/class-wp-hook.php on line 287 and defined in PathToWordpress/web/app/themes/theme-name/functions.php:362Stack trace:#0 PathToWordpress/web/wp/wp-includes/class-wp-hook.php(287): setup_phpmailer_init()#1 PathToWordpress/web/wp/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters()#2 PathToWordpress/web/wp/wp-includes/plugin.php(544): WP_Hook->do_action()#3 PathToWordpress/web/wp/wp-includes/pluggable.php(494): do_action_ref_array()#4 PathToWordpress/web/app/plugins/woocommerce/includes/class-wc-emails.php(650): wp_mail()#5 PathToWordpress/web/wp/wp-includes/class-wp-hook.php(287): WC_Emails->no_stock()#6 PathToWordpress/web/wp/wp-includes/class-wp-hook.php(311): WP_Hook->apply in PathToWordpress/web/app/themes/theme-name/functions.php on line 362可能是什么原因?qū)е麓隋e(cuò)誤?
查看完整描述

1 回答

?
開(kāi)心每一天1111

TA貢獻(xiàn)1836條經(jīng)驗(yàn) 獲得超13個(gè)贊

轉(zhuǎn)動(dòng)這條線:


函數(shù) setup_phpmailer_init( PHPMailer $phpmailer) {


進(jìn)入此(刪除 PHPMailer)修復(fù)了錯(cuò)誤


函數(shù) setup_phpmailer_init($phpmailer) {


我不完全確定為什么


查看完整回答
反對(duì) 回復(fù) 2023-10-15
  • 1 回答
  • 0 關(guān)注
  • 121 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)