Forum Moderators: coopster

Message Too Old, No Replies

PHP Mail Problems on Some Servers!

just curious....

         

dreamcatcher

1:58 pm on Jan 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Guys,

Both me and a my friend are on Web Hosting servers. Now, I`ve just set up a Guestbook script on his server, but the e-mail notification to let you know if a new reply has been posted doesn`t work. I set the script up on my server and it works fine. The script uses the standard PHP mail() function.

Now I`ve tried a simple contact form on his server, again using the mail() function and this works fine.

So, just curious, how come the mail() function works with the contact form, but not with the guestbook script?

I have since contacted the hosting company about this and they say that everything is configured fine with sendmail on the server and both scripts should work.

So, its a mystery. I was just wondering if any of you guys had encountered a similar problem?

Thanks. :)

jatar_k

12:12 am on Jan 18, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



maybe try doing some comparisons with the two scripts to see if there are any glaring differences.

Is the mail not being sent or not being received?

Have you checked your mail headers?

Have you tested the return value from the mail function to see if the mail function is failing?

Have you looked at the mail logs to see if the email even appears? (probably not a possibility on a shared host though)

dreamcatcher

1:46 am on Jan 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks jatar_k. Well, the mail is definitely not being received and I`ve checked the mail logs for unrouted mail and this is blank. The headers are ok, so its not that either.

I have also changed the code around a little to try and get the mail to work, but nothing, so now I`m back to the original script .php file. I have also deleted and reuploaded the files, figured it was a long shot but worth a try. Still nothing.

My friend isn`t that bothered, but I`m kind of curious myself. If it mysteriously starts working I`ll post again.

:)

dreamcatcher

2:13 am on Jan 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



well what do you know, I got it working. :) I just removed the whole block of code from the script and put some new code in and hey presto, its working. So, maybe it WAS to do with the script after all?

ok, NOW I can go get some sleep....:)

jatar_k

3:09 am on Jan 18, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



maybe it was but who knows. I hate mail, there are a million things that can go wrong even if the script is working properly.

glad you got it working ;)

dreamcatcher

9:41 am on Jan 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think in this instance the key was the isset() function. I changed all the code Friday and it didn`t work, but then I didn`t use the isset function that time around to check the state of the POST variable. I have since removed the isset function and it doesn`t work again, but when I put it back it does.

At least I know for next time. :)