ChrisAppStatic v0.4

PHP sendmail( ) test

What it does: Sends a simple email using mail() to confirm outbound mail is configured. Set the recipient and align SPF/DKIM/SMTP as needed.

Note: Production apps often use SMTP with authentication rather than mail().

Code

<?php
$to = "email@example.com"; // change me
$ok = mail($to,"Test","Hello from PHP","From: noreply@".$_SERVER['HTTP_HOST']);
echo $ok ? "Sent" : "Failed";
?>

Open live script

Live Demo

For safety, this page links out to the live script rather than auto-running it.

Open live mail() test

← Back to home