SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Wizard spence_noodle's Avatar
    Join Date
    Jan 2004
    Location
    uk, Leeds (area)
    Posts
    1,264
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)

    Post 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.
    1. 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.
    2. 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.
    I was using cPanel 10, but I'm now on CP 11. I think from CP 10 they have changed the way sending email through php by making sure the account does exist. Maybe it's a bug or not we will have to wait and see, unless anyone can shed some light.

    spence

  2. #2
    SitePoint Zealot asmictech's Avatar
    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!!!.
    Success is achieved and maintained by those who keep trying.

    www.ngportal.net

  3. #3
    SitePoint Wizard spence_noodle's Avatar
    Join Date
    Jan 2004
    Location
    uk, Leeds (area)
    Posts
    1,264
    Mentioned
    1 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.

  4. #4
    SitePoint Wizard spence_noodle's Avatar
    Join Date
    Jan 2004
    Location
    uk, Leeds (area)
    Posts
    1,264
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)

    Unhappy 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


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •