@brandy
To configure PHP mail in XAMPP, follow these steps:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
<?php $to = "[email protected]"; $subject = "Test mail"; $message = "This is a test email"; $headers = "From: [email protected]"; $mail_sent = mail($to, $subject, $message, $headers); if ($mail_sent) { echo "Email sent successfully"; } else { echo "Failed to send email"; } ?> |
Replace [email protected]
and [email protected]
with the actual email addresses you want to use. Save the script in your XAMPP htdocs
directory and access it through a web browser to test sending an email.
If the email is sent successfully, then PHP mail is configured properly in XAMPP. If there are any issues, check the error_log
file in XAMPP for any error messages that may help troubleshoot the problem.