🔒 Email Diagnostics

Authentication Required

❌ Incorrect password

1800)) { session_destroy(); header('Location: ' . $_SERVER['PHP_SELF']); exit; } // Self-delete functionality if (isset($_GET['delete_now']) && $_GET['delete_now'] === 'confirm') { $filename = basename(__FILE__); session_destroy(); if (@unlink(__FILE__)) { die("

✓ File '{$filename}' deleted successfully!

The diagnostic tool has been removed from the server.

"); } else { die("

✗ Failed to delete file

Please delete manually: {$filename}

"); } } // Logout functionality if (isset($_GET['logout'])) { session_destroy(); header('Location: ' . $_SERVER['PHP_SELF']); exit; } // ============================================================================ // MULTI-DOMAIN CONFIGURATION // ============================================================================ /** * CONFIGURATION - Customize for your website * * Option 1: Auto-detect domain from server (recommended for single-site use) * Option 2: Manually configure multiple domains below */ // Auto-detect current server domain $detectedDomain = $_SERVER['SERVER_NAME'] ?? $_SERVER['HTTP_HOST'] ?? 'localhost'; // Remove www. prefix if present $detectedDomain = preg_replace('/^www\./', '', $detectedDomain); // Default test email - CHANGE THIS to your email address $DEFAULT_TEST_EMAIL = 'webgraphicshub@gmail.com'; // ⚠️ CHANGE THIS! /** * Domain configurations * The script will auto-detect the current domain and use its configuration * Add your domains here as needed */ $DOMAIN_CONFIGS = [ // Auto-detected domain configuration (will be populated below) $detectedDomain => [ 'domain' => $detectedDomain, 'test_email' => $DEFAULT_TEST_EMAIL, 'from_emails' => [ "noreply@{$detectedDomain}", "info@{$detectedDomain}", "admin@{$detectedDomain}", "contact@{$detectedDomain}" ], 'smtp' => null // Use server default mail() ], // Add more domains here for multi-site testing /* 'example.com' => [ 'domain' => 'example.com', 'test_email' => 'admin@example.com', 'from_emails' => [ 'noreply@example.com', 'info@example.com' ], 'smtp' => [ 'host' => 'smtp.example.com', 'port' => 587, 'username' => 'user@example.com', 'password' => 'your-password', 'encryption' => 'tls' // or 'ssl' ] ], */ ]; // Select active domain (can be changed via URL parameter, defaults to detected domain) $activeDomain = $_GET['domain'] ?? $detectedDomain; if (!isset($DOMAIN_CONFIGS[$activeDomain])) { $activeDomain = $detectedDomain; } $CONFIG = $DOMAIN_CONFIGS[$activeDomain]; // ============================================================================ // HELPER FUNCTIONS // ============================================================================ // Email sending log $emailLog = []; /** * Try to send email with fallback mechanism */ function sendEmailWithFallback($to, $subject, $message, $isHTML = false) { global $CONFIG, $emailLog; $logEntry = [ 'to' => $to, 'subject' => $subject, 'attempts' => [], 'success' => false, 'final_sender' => null ]; // Get server default email $serverName = $_SERVER['SERVER_NAME'] ?? 'localhost'; $serverDefaultEmail = ini_get('sendmail_from') ?: "noreply@{$serverName}"; // Build list of emails to try (user-defined + server default) $emailsToTry = $CONFIG['from_emails']; if (!in_array($serverDefaultEmail, $emailsToTry)) { $emailsToTry[] = $serverDefaultEmail; } // Try each sender email foreach ($emailsToTry as $fromEmail) { $headers = "From: {$fromEmail}\r\n"; $headers .= "Reply-To: {$fromEmail}\r\n"; $headers .= "X-Mailer: PHP/" . phpversion() . "\r\n"; if ($isHTML) { $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=UTF-8\r\n"; } $attempt = [ 'from' => $fromEmail, 'method' => 'PHP mail()', 'timestamp' => date('Y-m-d H:i:s'), 'success' => false, 'error' => null ]; // Try sending $sent = @mail($to, $subject, $message, $headers); if ($sent) { $attempt['success'] = true; $logEntry['success'] = true; $logEntry['final_sender'] = $fromEmail; $logEntry['attempts'][] = $attempt; break; // Success! Stop trying } else { $attempt['error'] = error_get_last()['message'] ?? 'Unknown error'; $logEntry['attempts'][] = $attempt; } } $emailLog[] = $logEntry; return $logEntry['success']; } /** * Send email ONLY from server default (no fallback) * Used for manual testing via UI button */ function sendEmailFromServerDefault($to, $subject, $message, $isHTML = false) { global $emailLog; // Get server default email $serverName = $_SERVER['SERVER_NAME'] ?? 'localhost'; $serverDefaultEmail = ini_get('sendmail_from') ?: "noreply@{$serverName}"; $logEntry = [ 'to' => $to, 'subject' => $subject, 'attempts' => [], 'success' => false, 'final_sender' => null, 'manual_test' => true ]; $headers = "From: {$serverDefaultEmail}\r\n"; $headers .= "Reply-To: {$serverDefaultEmail}\r\n"; $headers .= "X-Mailer: PHP/" . phpversion() . "\r\n"; if ($isHTML) { $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=UTF-8\r\n"; } $attempt = [ 'from' => $serverDefaultEmail, 'method' => 'PHP mail() - Server Default Only', 'timestamp' => date('Y-m-d H:i:s'), 'success' => false, 'error' => null ]; // Try sending $sent = @mail($to, $subject, $message, $headers); if ($sent) { $attempt['success'] = true; $logEntry['success'] = true; $logEntry['final_sender'] = $serverDefaultEmail; } else { $attempt['error'] = error_get_last()['message'] ?? 'Unknown error'; } $logEntry['attempts'][] = $attempt; $emailLog[] = $logEntry; return $logEntry['success']; } // Check if domain is blacklisted function checkBlacklist($ip) { $blacklists = [ 'zen.spamhaus.org' => 'Spamhaus', 'bl.spamcop.net' => 'SpamCop', 'b.barracudacentral.org' => 'Barracuda', 'dnsbl.sorbs.net' => 'SORBS' ]; $results = []; $reverse_ip = implode('.', array_reverse(explode('.', $ip))); foreach ($blacklists as $bl => $name) { $lookup = $reverse_ip . '.' . $bl; $result = @gethostbyname($lookup); $listed = ($result !== $lookup && $result !== $reverse_ip . '.' . $bl); $results[$name] = $listed; } return $results; } // Check SPF record function checkSPF($domain) { $records = @dns_get_record($domain, DNS_TXT); if (!$records) return null; foreach ($records as $record) { if (isset($record['txt']) && strpos($record['txt'], 'v=spf1') === 0) { return $record['txt']; } } return null; } // Check DMARC record function checkDMARC($domain) { $dmarc_domain = '_dmarc.' . $domain; $records = @dns_get_record($dmarc_domain, DNS_TXT); if (!$records) return null; foreach ($records as $record) { if (isset($record['txt']) && strpos($record['txt'], 'v=DMARC1') === 0) { return $record['txt']; } } return null; } // Calculate deliverability score function calculateDeliverabilityScore($checks) { $total = 0; $passed = 0; foreach ($checks as $check) { $total++; if ($check) $passed++; } return $total > 0 ? round(($passed / $total) * 100) : 0; } /** * Detect email provider from MX records * Returns array with provider info and recommendations */ function detectEmailProvider($mxRecords) { if (empty($mxRecords)) { return [ 'provider' => 'Unknown', 'is_third_party' => false, 'requires_smtp' => false, 'warning' => null ]; } $mxString = strtolower(implode(' ', $mxRecords)); // Check for common providers $providers = [ 'icloud' => [ 'name' => 'Apple iCloud Mail', 'patterns' => ['icloud.com', 'apple.com'], 'smtp_host' => 'smtp.mail.me.com', 'smtp_port' => 587, 'requires_smtp' => true ], 'gmail' => [ 'name' => 'Google Gmail/Workspace', 'patterns' => ['google.com', 'googlemail.com', 'gmail.com'], 'smtp_host' => 'smtp.gmail.com', 'smtp_port' => 587, 'requires_smtp' => true ], 'office365' => [ 'name' => 'Microsoft Office 365', 'patterns' => ['outlook.com', 'office365.com', 'microsoft.com'], 'smtp_host' => 'smtp.office365.com', 'smtp_port' => 587, 'requires_smtp' => true ], 'zoho' => [ 'name' => 'Zoho Mail', 'patterns' => ['zoho.com', 'zohomail.com'], 'smtp_host' => 'smtp.zoho.com', 'smtp_port' => 587, 'requires_smtp' => true ], 'protonmail' => [ 'name' => 'ProtonMail', 'patterns' => ['protonmail.ch', 'proton.me'], 'smtp_host' => 'smtp.protonmail.ch', 'smtp_port' => 587, 'requires_smtp' => true ], 'mailgun' => [ 'name' => 'Mailgun', 'patterns' => ['mailgun.org'], 'smtp_host' => 'smtp.mailgun.org', 'smtp_port' => 587, 'requires_smtp' => true ], 'sendgrid' => [ 'name' => 'SendGrid', 'patterns' => ['sendgrid.net'], 'smtp_host' => 'smtp.sendgrid.net', 'smtp_port' => 587, 'requires_smtp' => true ] ]; foreach ($providers as $key => $provider) { foreach ($provider['patterns'] as $pattern) { if (strpos($mxString, $pattern) !== false) { return [ 'provider' => $provider['name'], 'provider_key' => $key, 'is_third_party' => true, 'requires_smtp' => $provider['requires_smtp'], 'smtp_host' => $provider['smtp_host'], 'smtp_port' => $provider['smtp_port'], 'mx_records' => $mxRecords ]; } } } // Unknown provider but has MX records return [ 'provider' => 'Custom/Self-hosted', 'is_third_party' => false, 'requires_smtp' => false, 'mx_records' => $mxRecords ]; } // ============================================================================ // HTML OUTPUT FUNCTIONS // ============================================================================ function outputHeader() { global $DOMAIN_CONFIGS, $activeDomain; ?> Email Diagnostics Report - <?php echo htmlspecialchars($activeDomain); ?>

📧 Email Diagnostics Report

Generated:
1): ?>
Select Domain: $config): ?>

📋 Current Configuration:

"; echo "
{$name} {$statusText}"; echo ""; echo "
"; if ($details) { echo "
{$details}
"; } echo ""; } function sectionHeader($title) { echo "
{$title}
"; } function sectionFooter() { echo "
"; } // ============================================================================ // DIAGNOSTIC TESTS // ============================================================================ $results = [ 'total' => 0, 'passed' => 0, 'failed' => 0, 'warnings' => 0 ]; $deliverabilityChecks = []; function recordResult($passed, $weight = 1) { global $results, $deliverabilityChecks; $results['total']++; if ($passed) { $results['passed']++; } else { $results['failed']++; } $deliverabilityChecks[] = $passed; } outputHeader(); // ============================================================================ // DELIVERABILITY SCORE (will be shown at top) // ============================================================================ $emailDomain = $CONFIG['domain']; $serverIP = $_SERVER['SERVER_ADDR'] ?? gethostbyname($_SERVER['SERVER_NAME'] ?? 'localhost'); // Pre-calculate some checks for score $spfRecord = checkSPF($emailDomain); $dmarcRecord = checkDMARC($emailDomain); $blacklistResults = checkBlacklist($serverIP); $mailFunctionExists = function_exists('mail'); $reverseDNS = @gethostbyaddr($serverIP); // ============================================================================ // 1. EMAIL AUTHENTICATION (SPF/DKIM/DMARC) // ============================================================================ sectionHeader("🔐 1. Email Authentication (SPF/DKIM/DMARC)"); // SPF Check $spfExists = !empty($spfRecord); testResult( "SPF Record for {$emailDomain}", $spfExists, $spfExists ? "Found: {$spfRecord}" : "No SPF record found. This may cause deliverability issues." ); recordResult($spfExists); // DMARC Check $dmarcExists = !empty($dmarcRecord); testResult( "DMARC Record for {$emailDomain}", $dmarcExists, $dmarcExists ? "Found: {$dmarcRecord}" : "No DMARC record found. Recommended for email security." ); recordResult($dmarcExists); // DKIM Check (basic - just check if selector exists) echo "
"; echo "💡 DKIM Check: DKIM requires specific selector configuration. "; echo "Common selectors: default, google, mail. Check your DNS for TXT records like 'default._domainkey.{$emailDomain}'"; echo "
"; sectionFooter(); // ============================================================================ // 2. BLACKLIST CHECK // ============================================================================ sectionHeader("🚫 2. Blacklist Check"); echo "
Server IP: {$serverIP}
"; $blacklisted = false; foreach ($blacklistResults as $name => $listed) { testResult( "{$name} Blacklist", !$listed, $listed ? "⚠️ IP is BLACKLISTED on {$name}" : "✓ Not blacklisted" ); if ($listed) $blacklisted = true; recordResult(!$listed); } if ($blacklisted) { echo "
"; echo "⚠️ Warning: Your server IP is blacklisted! This will severely impact email deliverability. "; echo "Contact your hosting provider or visit the blacklist website to request removal."; echo "
"; } sectionFooter(); // ============================================================================ // 3. REVERSE DNS CHECK // ============================================================================ sectionHeader("🔄 3. Reverse DNS (PTR Record)"); $reverseDNSValid = ($reverseDNS && $reverseDNS !== $serverIP); testResult( "Reverse DNS for {$serverIP}", $reverseDNSValid, $reverseDNSValid ? "PTR Record: {$reverseDNS}" : "No reverse DNS configured. This may affect deliverability." ); recordResult($reverseDNSValid); sectionFooter(); // ============================================================================ // 4. PHP MAIL CONFIGURATION // ============================================================================ sectionHeader("⚙️ 4. PHP Mail Configuration"); $mailFunctionExists = function_exists('mail'); testResult( "mail() Function Available", $mailFunctionExists, $mailFunctionExists ? "The mail() function is available" : "mail() function is NOT available" ); recordResult($mailFunctionExists); $sendmailPath = ini_get('sendmail_path'); testResult( "Sendmail Path", !empty($sendmailPath), "Path: " . ($sendmailPath ?: 'Not configured') ); $SMTPServer = ini_get('SMTP'); $SMTPPort = ini_get('smtp_port'); testResult( "SMTP Configuration", !empty($SMTPServer) || PHP_OS_FAMILY !== 'Windows', "Server: " . ($SMTPServer ?: 'Not set') . " | Port: " . ($SMTPPort ?: 'Not set') ); sectionFooter(); // ============================================================================ // 5. DNS AND MX RECORDS // ============================================================================ sectionHeader("🌐 5. DNS and MX Records"); $dnsRecords = @dns_get_record($emailDomain, DNS_A); $dnsResolved = !empty($dnsRecords); testResult( "DNS Resolution for {$emailDomain}", $dnsResolved, $dnsResolved ? "Resolves to: " . ($dnsRecords[0]['ip'] ?? 'Unknown') : "Cannot resolve domain" ); recordResult($dnsResolved); $mxRecords = []; $mxExists = @getmxrr($emailDomain, $mxRecords); // Detect email provider from MX records $providerInfo = detectEmailProvider($mxRecords); testResult( "MX Records for {$emailDomain}", $mxExists, $mxExists ? "Found " . count($mxRecords) . " record(s): " . implode(', ', array_slice($mxRecords, 0, 3)) : "No MX records" ); recordResult($mxExists); // Display provider information if ($mxExists) { echo "
"; echo "
Email Provider Detected"; if ($providerInfo['is_third_party']) { echo " THIRD-PARTY"; } else { echo " SELF-HOSTED"; } echo "
"; echo "
"; echo "Provider: " . htmlspecialchars($providerInfo['provider']) . "
"; echo "MX Records: " . implode(', ', array_slice($mxRecords, 0, 5)); echo "
"; echo "
"; // Warning for third-party providers if ($providerInfo['is_third_party'] && $providerInfo['requires_smtp']) { echo "
"; echo "⚠️ CRITICAL: Third-Party Email Provider Detected!

"; echo "Your domain {$emailDomain} uses {$providerInfo['provider']} for email.

"; echo "This means:
"; echo "• You CANNOT send emails FROM @{$emailDomain} using PHP mail() function
"; echo "• Your server is NOT authorized to send emails for this domain
"; echo "• Emails sent from noreply@{$emailDomain} will likely FAIL or go to SPAM

"; echo "✅ Solutions:
"; echo "1. Use SMTP Authentication (Recommended):
"; echo " - SMTP Host: {$providerInfo['smtp_host']}
"; echo " - SMTP Port: {$providerInfo['smtp_port']}
"; echo " - Username: Your {$providerInfo['provider']} email address
"; echo " - Password: Your {$providerInfo['provider']} password or app-specific password

"; echo "2. Use Server Default Email:
"; echo " - Click the 'Send Test from Server Default' button below
"; echo " - This uses your server's email (not @{$emailDomain})
"; echo " - More likely to work but won't match your domain

"; echo "3. Use a Transactional Email Service:
"; echo " - SendGrid, Mailgun, Amazon SES, Postmark
"; echo " - These are designed for sending emails from web applications
"; echo "
"; } } sectionFooter(); // ============================================================================ // 6. EMAIL SENDING TESTS WITH FALLBACK // ============================================================================ sectionHeader("📤 6. Email Sending Tests (with Fallback Mechanism)"); // Check if manual server default test was requested $serverDefaultTestRequested = isset($_GET['test_server_default']) && $_GET['test_server_default'] === '1'; // Get server default email for display $serverName = $_SERVER['SERVER_NAME'] ?? 'localhost'; $serverDefaultEmail = ini_get('sendmail_from') ?: "noreply@{$serverName}"; // Manual Server Default Email Test Section echo "
"; echo "🔧 Manual Test: Server Default Email
"; echo "Server default email address: " . htmlspecialchars($serverDefaultEmail) . "
"; echo "Click the button below to send a test email ONLY from the server default address (no fallback, no domain-specific emails)."; echo "

"; echo "📧 Send Test from Server Default"; echo "
"; // Process manual server default test if requested if ($serverDefaultTestRequested) { echo "
"; echo "� Manual Server Default Test Triggered
"; echo "Sending test email from server default address only..."; echo "
"; $serverTestSubject = "Server Default Email Test - " . date('Y-m-d H:i:s'); $serverTestMessage = "This is a manual test email sent ONLY from the server default address.\n\nServer Default Email: {$serverDefaultEmail}\nDomain: {$emailDomain}\nServer: " . ($_SERVER['SERVER_NAME'] ?? 'Unknown') . "\nIP: {$serverIP}\nTime: " . date('Y-m-d H:i:s'); $serverTestSent = sendEmailFromServerDefault($CONFIG['test_email'], $serverTestSubject, $serverTestMessage, false); testResult( "Manual Server Default Email Test", $serverTestSent, $serverTestSent ? "✓ Sent from {$serverDefaultEmail} to {$CONFIG['test_email']}" : "✗ Failed to send from server default" ); } echo "
"; echo "📝 Automatic Tests (with fallback): The tests below will try to send emails using each configured sender address in order. "; echo "If one fails, it automatically tries the next one. The server default email is used as the final fallback."; echo "
"; // Simple text email $subject1 = "Email Diagnostic Test - " . date('Y-m-d H:i:s'); $message1 = "Test email from Email Diagnostics Tool\n\nDomain: {$emailDomain}\nServer: " . ($_SERVER['SERVER_NAME'] ?? 'Unknown') . "\nIP: {$serverIP}\nTime: " . date('Y-m-d H:i:s'); $sent1 = sendEmailWithFallback($CONFIG['test_email'], $subject1, $message1, false); testResult( "Simple Text Email", $sent1, $sent1 ? "✓ Sent to {$CONFIG['test_email']}" : "✗ All sender addresses failed" ); recordResult($sent1); // HTML email $subject2 = "Email Diagnostic Test (HTML) - " . date('Y-m-d H:i:s'); $message2 = "

Email Diagnostic Test

This is an HTML test email.

Domain: {$emailDomain}

Server: " . ($_SERVER['SERVER_NAME'] ?? 'Unknown') . "

"; $sent2 = sendEmailWithFallback($CONFIG['test_email'], $subject2, $message2, true); testResult( "HTML Email", $sent2, $sent2 ? "✓ Sent to {$CONFIG['test_email']}" : "✗ All sender addresses failed" ); recordResult($sent2); // Display email sending log echo "
"; echo "

📋 Detailed Email Sending Log

"; foreach ($emailLog as $log) { $logClass = $log['success'] ? 'success' : 'failed'; $isManualTest = isset($log['manual_test']) && $log['manual_test']; echo "
"; echo "

"; echo $log['success'] ? "✅ SUCCESS" : "❌ FAILED"; if ($isManualTest) { echo " MANUAL TEST"; } echo " - To: " . htmlspecialchars($log['to']); if ($log['final_sender']) { echo " | Sent from: " . htmlspecialchars($log['final_sender']) . ""; } echo "

"; echo "
Subject: " . htmlspecialchars($log['subject']) . "
"; echo "
Attempts:
"; foreach ($log['attempts'] as $idx => $attempt) { $attemptClass = $attempt['success'] ? 'success' : 'failed'; echo "
"; echo "Attempt " . ($idx + 1) . ": "; echo "From: " . htmlspecialchars($attempt['from']) . " | "; echo "Method: " . htmlspecialchars($attempt['method']) . " | "; echo "Time: " . htmlspecialchars($attempt['timestamp']) . " | "; echo $attempt['success'] ? "✓ SUCCESS" : "✗ FAILED"; if ($attempt['error']) { echo "
Error: " . htmlspecialchars($attempt['error']) . ""; } echo "
"; } echo "
"; } echo "
"; sectionFooter(); // ============================================================================ // 7. PHP EXTENSIONS // ============================================================================ sectionHeader("🔌 7. PHP Extensions for Email"); $extensions = [ 'openssl' => 'Required for TLS/SSL SMTP', 'sockets' => 'Required for socket-based SMTP', 'mbstring' => 'For multibyte string handling', ]; foreach ($extensions as $ext => $description) { $loaded = extension_loaded($ext); testResult( "{$ext} Extension", $loaded, $description . " - " . ($loaded ? "Loaded" : "Not loaded") ); } sectionFooter(); // ============================================================================ // DELIVERABILITY SCORE // ============================================================================ $deliverabilityScore = calculateDeliverabilityScore($deliverabilityChecks); $scoreClass = 'score-poor'; $scoreLabel = 'Poor'; if ($deliverabilityScore >= 80) { $scoreClass = 'score-excellent'; $scoreLabel = 'Excellent'; } elseif ($deliverabilityScore >= 60) { $scoreClass = 'score-good'; $scoreLabel = 'Good'; } elseif ($deliverabilityScore >= 40) { $scoreClass = 'score-fair'; $scoreLabel = 'Fair'; } echo "
"; echo "

📊 Email Deliverability Score

"; echo "
{$deliverabilityScore}
"; echo "
{$scoreLabel}
"; echo "
Based on " . count($deliverabilityChecks) . " critical checks
"; echo "
"; // ============================================================================ // SUMMARY // ============================================================================ $passRate = $results['total'] > 0 ? round(($results['passed'] / $results['total']) * 100, 1) : 0; echo "
"; echo "

Test Summary

"; echo "
"; echo "
{$results['total']}
Total Tests
"; echo "
{$results['passed']}
Passed
"; echo "
{$results['failed']}
Failed
"; echo "
{$passRate}%
Pass Rate
"; echo "
"; echo "
"; // ============================================================================ // RECOMMENDATIONS // ============================================================================ sectionHeader("💡 Recommendations"); if (!$spfExists) { echo "
⚠️ Add SPF Record: Create a TXT record: v=spf1 a mx ~all
"; } if (!$dmarcExists) { echo "
⚠️ Add DMARC Record: Create a TXT record for _dmarc.{$emailDomain}: v=DMARC1; p=quarantine; rua=mailto:admin@{$emailDomain}
"; } if ($blacklisted) { echo "
🚨 Remove from Blacklists: Contact your hosting provider or request delisting from the blacklist websites.
"; } if (!$reverseDNSValid) { echo "
⚠️ Configure Reverse DNS: Contact your hosting provider to set up PTR record for {$serverIP}
"; } if ($deliverabilityScore < 60) { echo "
🚨 Low Deliverability Score: Your email configuration needs improvement. Consider using external SMTP services like SendGrid, Mailgun, or Amazon SES.
"; } elseif ($deliverabilityScore < 80) { echo "
⚠️ Moderate Deliverability: Some improvements needed. Review failed checks above.
"; } else { echo "
✅ Good Configuration: Your email setup looks good! Check {$CONFIG['test_email']} for test emails.
"; } echo "
"; echo "📝 Best Practices:
"; echo "• Use external SMTP services for production (SendGrid, Mailgun, AWS SES)
"; echo "• Implement DKIM signing for better authentication
"; echo "• Monitor your sender reputation regularly
"; echo "• Keep your IP off blacklists
"; echo "• Use dedicated IP for high-volume sending
"; echo "• Always use valid, domain-matching sender addresses"; echo "
"; sectionFooter(); // ============================================================================ // CONFIGURATION DETAILS // ============================================================================ sectionHeader("📋 PHP Mail Configuration"); $mailConfig = [ 'sendmail_path' => ini_get('sendmail_path'), 'mail.add_x_header' => ini_get('mail.add_x_header'), 'mail.log' => ini_get('mail.log'), 'SMTP' => ini_get('SMTP'), 'smtp_port' => ini_get('smtp_port'), 'sendmail_from' => ini_get('sendmail_from'), ]; echo "
"; foreach ($mailConfig as $key => $value) { echo htmlspecialchars($key) . " = " . htmlspecialchars($value ?: '(not set)') . "\n"; } echo "
"; sectionFooter(); outputFooter(); ?>