| Server IP : 65.108.144.40 / Your IP : 216.73.217.165 Web Server : Apache/2.4.52 (Ubuntu) System : Linux ubuntu-8gb-hel1-1 5.15.0-173-generic #183-Ubuntu SMP Fri Mar 6 13:29:34 UTC 2026 x86_64 User : dev ( 1000) PHP Version : 8.2.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/capital-catering/web/app/themes/capital-catering/ |
Upload File : |
<?php
// Test email script for local debugging
require_once('../../../wp-config.php');
// Test basic wp_mail function
echo "Testing basic wp_mail...\n";
$test_result = wp_mail('test@example.com', 'Test Email', 'This is a test email from local machine');
echo "wp_mail result: " . ($test_result ? 'SUCCESS' : 'FAILED') . "\n";
// Test with SMTP configuration
echo "\nTesting with SMTP configuration...\n";
// Set up SMTP manually for testing
add_action('phpmailer_init', function($phpmailer) {
$phpmailer->isSMTP();
$phpmailer->Host = 'smtp.office365.com';
$phpmailer->SMTPAuth = true;
$phpmailer->Port = 587;
$phpmailer->Username = 'noreply@capitalcateringplus.ae';
$phpmailer->Password = 'Windowsupdate@2025';
$phpmailer->SMTPSecure = 'tls';
$phpmailer->From = 'noreply@capitalcateringplus.ae';
$phpmailer->FromName = 'Capital Catering +';
// Enable debug output
$phpmailer->SMTPDebug = 2;
$phpmailer->Debugoutput = function ($str, $level) {
echo "SMTP DEBUG: $str\n";
};
});
$smtp_result = wp_mail('test@example.com', 'SMTP Test Email', 'This is a test email using SMTP configuration');
echo "SMTP wp_mail result: " . ($smtp_result ? 'SUCCESS' : 'FAILED') . "\n";
// Test WooCommerce mailer
echo "\nTesting WooCommerce mailer...\n";
if (class_exists('WC')) {
$mailer = WC()->mailer();
if ($mailer) {
echo "WooCommerce mailer initialized successfully\n";
// Test sending a simple email
$wc_result = $mailer->send('test@example.com', 'WC Test Subject', 'WC Test Message', ['Content-Type: text/html; charset=UTF-8']);
echo "WooCommerce mailer result: " . ($wc_result ? 'SUCCESS' : 'FAILED') . "\n";
} else {
echo "WooCommerce mailer not available\n";
}
} else {
echo "WooCommerce not loaded\n";
}
echo "\nTest completed.\n";
?>