Path : /home/vishqocm/pcib.in/temp/
File Upload :
Current File : /home/vishqocm/pcib.in/temp/test_contact_email.php

<?php
// Test script for contact form email functionality

// Include the mail configuration
require_once '../includes/mail_config.php';

// Test data
$name = "Test User";
$email = "[email protected]";
$subject = "Test Email from Contact Form";
$message = "This is a test message to verify the contact form email functionality.";
$phone = "123-456-7890";

// Attempt to send the email
$result = sendContactFormEmail($name, $email, $subject, $message, $phone);

// Display the result
if ($result) {
    echo "<h2 style='color:green'>Test email sent successfully!</h2>";
    echo "<p>An email should have been sent to [email protected]</p>";
    echo "<p>Check your Gmail inbox (and spam folder) to verify.</p>";
} else {
    echo "<h2 style='color:red'>Failed to send test email!</h2>";
    echo "<p>Check the error logs for more information.</p>";
}

// Display the configuration details (without password)
echo "<h3>Email Configuration:</h3>";
echo "<ul>";
echo "<li>SMTP Server: smtp.gmail.com</li>";
echo "<li>Username: [email protected]</li>";
echo "<li>Recipient: [email protected]</li>";
echo "</ul>";

// Note about Gmail app password
echo "<h3>Important Note:</h3>";
echo "<p>For Gmail to work properly, you need to:</p>";
echo "<ol>";
echo "<li>Enable 2-Factor Authentication on your Google account</li>";
echo "<li>Generate an App Password specifically for this application</li>";
echo "<li>Use that App Password in the mail_config.php file</li>";
echo "</ol>";
echo "<p>See <a href='https://support.google.com/accounts/answer/185833' target='_blank'>Google's documentation</a> for instructions.</p>";
?>