I have been trying to make a simple php mail script, but it won't work! Here is the source below...why wont this work?

<?php
mail("tucker401@mailbolt.com", "This is the message subject", "This is the message body");
echo "message has been sent.";
?>

-tucker-

Recommended Answers

All 5 Replies

Try

mail("tucker401@mailbolt.com", "This is the message subject", "This is the message body","From: admin@yourdomain.com");
echo "message has been sent.";

Try

mail("tucker401@mailbolt.com", "This is the message subject", "This is the message body","From: admin@yourdomain.com");
echo "message has been sent.";

That still doesn't work :sad: thanks for the help though.

-tucker-

The variables in mail function are as follow:
mail($to_email, $subject, $message, $headers);
$header is optinal.

Make sure your hosting is support mail delivery (smtp enable). You may want to try using other free hosting services.

Are you trying to run the script on your own computer aka localhost? or with under domain?

OMG it works now! I think the problem was i was trying to run it under a free hosting service that had php, but that didn't support mailing...but now that i have a paid service it works. Thanks so much for all the help guys.

-tucker-

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.