0
PHP Mail Function
Can i use PHP mail funtion in XAMPP
2 Respostas
+ 6
Yes, it is possible. You will need to configure a mail server in your php.ini file.
+ 5
Mohammed Safras yes as Keith mentioned
<?php
$to = "recipient@example.com"; // Replace with the recipient's email address
$subject = "Test Email from XAMPP";
$message = "Hello,\n\nThis is a test email sent from a PHP script running on XAMPP.";
$headers = "From: sender@example.com"; // Replace with your sender email address
// Attempt to send the email
if (mail($to, $subject, $message, $headers)) {
echo "Email successfully sent to $to...";
} else {
echo "Email sending failed.";
}
?>