PHP Server Side Scripting Forum

Hello all. Recently I put together some code that sends a form to an email address, and then another email address that is provided in the form. It was all working perfectly, for about a week until today when suddenly it does not work. NO CHANGES HAVE BEEN MADE to these files, they haven't been touched since my final check when it worked fine.

- how are you sending the mail -- using the mail() function? - what is the return status of the mail() function (TRUE or FALSE)? - what is in the web server's error_log? - what changed in the web server config? - what changed in the PHP config? - what changed in the sending mail server? - has your form been abused by spammers and the mail server admin decided to no longer relay your mails? - what changed elsewhere in the sending system? - what changed in the recipient's mail server? - are new anti-spam rules in effect in the receiving server? - is the sending mail server blacklisted on a DNSBL that is used by the receiving system for filtering? - did you sent the mail with a valid return address to see a bounce? - what is the bounce message then, if there is any? - what changed at the receiving mail client? - are new anti-spam rules in effect at the client? - has the mail been mislaid at the client's end (perhaps it is in the spam folder, if there is any).

This list may be incomplete, though. But as long as you don't give another hint on what part may "not work", it is hard to tell anything ....

Heres some info that may help, i am sending the mail using the mail() function We have our own server here, and my boss said that absolutely nothing has changed, and that I am the only person that could have changed anything (the only thing that has changed is that I added some things to the FTP site thinger, none of which are named anything remotely close to the two files in use by the form). There are no errors returned, after submitting the form, it shows my confirmation page. My form has not been abused, or used by anyone except myself, and the technicians that need it. The address of the sender is receiptghost@example.com, example.com is the same name that the receiving address uses which is receipts@example.com. We have checked the spam folder many times and we have not found a single one, however occasionally a form will get mailed through when I test it.

The form still shows up on the site, and after submitting I get my confirmation page. This entire system was operational early last week when I made the final changes to it and tested to it. If you would like I could provide a link to the site itself, or post my code.

The mail() function passes its parameters to the definied mail handler on the host system. On a unix system, the mailer binary (sendmail or a substitute) is started, on a windows system, the mail() function talks to a running MTA through a network socket. And it sends what you specify to appear in the To: / Text / Subject: / and other headers.

I would start with a simple test case with hand coded fields to test the basic mail path functionality. The '"receipts@example.com".$CustomerEmail' looks strange unless we know what is in $CustomerEmail ?

Make sure that the From: address is a valid address to receive and see technical bounce messages from the mail system(s).

And a I would wrap the mail() to get its status: if (mail(...)) { echo 'mail() passed';} else {echo 'something went wrong in mail()';} Depending on that status you may get a hint if there may be something wrong in the way your program works, or further down the chain beyond your program.