$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>email - How to integerate WordPress Mail SMTP plugin to Report and Request custom page|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

email - How to integerate WordPress Mail SMTP plugin to Report and Request custom page

matteradmin10PV0评论

Since a week ago, WordPress stopped to send normal emails upon new events like new user registration, new comments, and sucuri logs.

I tried everything but no luck, so i installed WP Mail SMTP to connect Gmail to my WordPress with Google API and it works fine.

But i have custom pages (Report and Request) that depends on default WordPress PHP mailer

so, how i integrate WP Mail SMTP inside these pages

here is an example of the report page

<?php 
if($_GET['report']) { 
require_once "form/captacha.php";
$siteKey = get_option('pc_key');
$secret = get_option('pv_key');
$resp = null;
$error = null;
$reCaptcha = new ReCaptcha($secret);
if ($_POST["g-recaptcha-response"]) {
$resp = $reCaptcha->verifyResponse(
$_SERVER["REMOTE_ADDR"],
$_POST["g-recaptcha-response"] ); }
if ($resp != null && $resp->success) { 
require("form/class.phpmailer.php");
$msg = "";
if ($_POST['action'] == "send") {
$vname = $_FILES['arch']['name'];
$vtemp = $_FILES['arch']['tmp_name'];
$rmailsend = get_option('reportemail');
$mail = new PHPMailer();
$mail->Host = "localhost";
$mail->From = $rmailsend;
$mail->FromName = __( "New Report", "demotheme" );
$mail->Subject = $_POST['videos'];
$mail->AddAddress($rmailsend);
if ($vname != "") {
$mail->AddAttachment($vtemp, $vname); }
$body = "body"

and here is the "class.phpmailer.php" file

Post a comment

comment list (0)

  1. No comments so far