SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
Thread: PHP Sendmail & Cpanel Tip
-
Aug 7, 2007, 08:54 #1
- Join Date
- Jan 2004
- Location
- uk, Leeds (area)
- Posts
- 1,264
- Mentioned
- 2 Post(s)
- Tagged
- 1 Thread(s)
PHP Sendmail & Cpanel Tip
Hi folks,
I've noticed fairly recently that when using php to send an email (with a script using mail() ) it does not work. It looks like the email has been sent but infact the email has not been sent. Whats confusing is their is no error message which does suggest that it has worked.
Now I may have found (or at least it works for me) two ways you can check to solve the problem.- Make sure the message within the script starts and ends with double quotes "message goes here". I think the email address does not matter too much, but try either single or double.
- This will not be obvious and it took me two days and another web host to figure out this. After checking the above the email was still not sent. The problem was that the email account I was using did not exist, so I made one through cPanel and bingo it worked.
spence"Don't you just love it when you solve a programming bug only to create another."
-
Aug 7, 2007, 09:48 #2
- Join Date
- Oct 2004
- Location
- nigeria
- Posts
- 151
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
More so, the Cpanel Tweak Setting might disallow NOBODY header info from sending mail. With this, your mail might not be sent if php suscex isn't installed or available. The good thing is that mails will only be sent after identification/authentication on the server -- reducing spam!!!.
-
Aug 7, 2007, 10:12 #3
- Join Date
- Jan 2004
- Location
- uk, Leeds (area)
- Posts
- 1,264
- Mentioned
- 2 Post(s)
- Tagged
- 1 Thread(s)
Well if the idea behind the tweak is to reduce spam then hopefully it will work. It's a good idea that we have to make separate email accounts, it makes things much easier sorting out which email goes where.
"Don't you just love it when you solve a programming bug only to create another."
-
Aug 15, 2007, 03:55 #4
- Join Date
- Jan 2004
- Location
- uk, Leeds (area)
- Posts
- 1,264
- Mentioned
- 2 Post(s)
- Tagged
- 1 Thread(s)
DAM, it happended again!
Yep, taking from what I said in the first post and if it still or happens again then contact your web host to check the mail server.
Turns out over the past two days the mail server was playing up and the script I've done was correct. The web host just rebooted the mail server and hey presto, it's now working.
A corrupted file was to blame in the end.
spence"Don't you just love it when you solve a programming bug only to create another."
Bookmarks