0

PHP Mail Function

Can i use PHP mail funtion in XAMPP

5th May 2025, 6:53 PM
Mohammed Safras
Mohammed Safras - avatar
2 Respostas
+ 6
Yes, it is possible. You will need to configure a mail server in your php.ini file.
5th May 2025, 7:25 PM
Keith
Keith - avatar
+ 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."; } ?>
5th May 2025, 7:43 PM
BroFar
BroFar - avatar