PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
OK, I had this working on an older version of my site and I really just copied and pasted most of the code to a new version of my site, and now my code inserts messages into the database, but it's not sending messages to the user's e-mail address. Thanks for your help!
No, there is not visible outcome, nor is there supposed to be. If I add in another echo for the email and tag, both will show up properly. Everything else on the script works, just the actual sending of mail doesnt work.
jeffyyy wrote:No, there is not visible outcome, nor is there supposed to be.
According to your script, on failure you should see an email address echoed to the browser. If nothing is echoed, it means your script is working. The other options is that the email address is not assigned to your '$to' variable.
<?php
$mail = mail($to, $subject, $message, $headers);
// on success nothing will echo
if ($mail) { echo ''; }
//edit for production
// if your mail is NOT sent, the email address
// should be submitted.
else {
echo $mail_address;
}
}
?>
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering