954,585 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Need help with Mail php script!!

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-

tucker
Newbie Poster
3 posts since Jun 2005
Reputation Points: 10
Solved Threads: 0
 

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

PoA
Posting Whiz in Training
237 posts since Jul 2004
Reputation Points: 26
Solved Threads: 9
 
Try [PHP]mail("tucker401@mailbolt.com", "This is the message subject", "This is the message body","From: admin@yourdomain.com"); echo "message has been sent."; [/PHP]


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

-tucker-

tucker
Newbie Poster
3 posts since Jun 2005
Reputation Points: 10
Solved Threads: 0
 

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.

zippee
Posting Whiz in Training
294 posts since Jan 2005
Reputation Points: 10
Solved Threads: 7
 

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

PoA
Posting Whiz in Training
237 posts since Jul 2004
Reputation Points: 26
Solved Threads: 9
 

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-

tucker
Newbie Poster
3 posts since Jun 2005
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You