Hey,
I have developed this basic email submission engine and it will not work. It keeps looping to the "Email did not submit!!!" echo statement.
Does anyone have any ideas why this will not work??
Here is the code:
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$comments = $_POST['comments'];
$content = "($name) with an email of ($email) made the following comments on your site: ($comments)";
$test = mail('joshyoung@localhost', 'Contact Response', 'test');
print_r($test);
if ($test)
{
echo "Email was sent sucessfully";
}
else {
echo "Email did not submit!!!";
}
echo "<br></br>";
?>
email posting engine not working?? - what is wrong?
Moderator: General Moderators
Re: email posting engine not working?? - what is wrong?
oh god I'm far from an expert in using localhost (I always use hosting services), but PHP uses port 25 and SMTP by default I think. SO check that you can use those. I think you can check your .ini for the php setting
I can also be very very wrong, but I thought I'd mention that (hopefully someone clears that up lol).
I can also be very very wrong, but I thought I'd mention that (hopefully someone clears that up lol).
Re: email posting engine not working?? - what is wrong?
Actually, that should not be the problem because I had it set to a valid email address and it did the same thing!
Thanks...
Thanks...
Re: email posting engine not working?? - what is wrong?
oh wow, what a blonde moment.........I have used mail() a few times but when I saw localhost I just jumped to the conclusion you were running it off a local machine (my localhost wont let me set cookies or send mail).
errr, so yah I'm not sure sorry for misunderstanding your problem first time around =/
errr, so yah I'm not sure sorry for misunderstanding your problem first time around =/
Re: email posting engine not working?? - what is wrong?
Thanks for the help though....
Anybody else have any ideas??
Thanks
Josh
Anybody else have any ideas??
Thanks
Josh