PHP Form Help

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!

Moderator: General Moderators

User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

First bit of advice, don't use short PHP tags (<? and ?>). Take the extra time to write out <?php. There was a recent post from a user who was stung by this because of an upgrade to a newer version of PHP in which it was off. Don't screw yourself early on with bad practices.

Second, make sure your host supports the mail function. Some hosts, like GoDaddy, disable the feature on certain accounts (like GoDaddy does on Windows servers running PHP).

Next, understand how mail works. The PHP Manual mail() page is a good place to start when it comes to learning what the mail function does and what it returns. Just because you are getting a succeful return doesn't mean that the message was sent. It only means that the mail was accepted for delivery.
The PHP Manual wrote: (taken from the mail() function page)
Return Values
Returns TRUE if the mail was successfully accepted for delivery, FALSE otherwise.

It is important to note that just because the mail was accepted for delivery, it does NOT mean the mail will actually reach the intended destination.
Post Reply