The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

php mail() error - cannot fix it!

Discussion in 'E-mail Discussions' started by tamer1009, Apr 1, 2010.

  1. tamer1009

    tamer1009 Member

    Joined:
    Apr 1, 2010
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Hello everyone,

    i have cPanel 11 VPS Optimized and i have a problem with php mail()

    example: users dont get a confirmation email.

    i have this unchecked:
    Prevent the user "nobody" from sending out mail to remote addresses (PHP and CGI scripts generally run as nobody if you are not using PHPSuexec and Suexec respectively.)

    What can i do now?

    phpmail is really important for me :/

    Thankyou
     
  2. tamer1009

    tamer1009 Member

    Joined:
    Apr 1, 2010
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    i tried anything, does someone know this problem?
     
  3. JawadArshad

    JawadArshad Well-Known Member
    PartnerNOC

    Joined:
    Apr 8, 2008
    Messages:
    447
    Likes Received:
    4
    Trophy Points:
    18
    Location:
    PK
    cPanel Access Level:
    DataCenter Provider
    Is there any error generated while running a sample mail() script or it runs but does not send an email. grep the sending/recipient email address used in the sample mail() script in the exim main log. You can also check if mail function is not disabled in php.ini.
     
  4. tamer1009

    tamer1009 Member

    Joined:
    Apr 1, 2010
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    where can i find the exim log in whm?

    and i checked the php.ini and the only thing i found about php mail() is:
    sendmail_path = "/usr/sbin/sendmail -t -i"

    what do i have to do now?

    thanks :)
     
  5. madaboutlinux

    madaboutlinux Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    1,052
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Earth
    What if you execute the script from the command line?

    scriptname.php is the one in which mail () function is used. Do you receive any error message?

    BTW, you have to check the exim mail logs from the server via SSH. SSH to your server as root and execute the following command:

    and browse the script OR you can also grep the email address mentioned in the script in the email logs

     
  6. JawadArshad

    JawadArshad Well-Known Member
    PartnerNOC

    Joined:
    Apr 8, 2008
    Messages:
    447
    Likes Received:
    4
    Trophy Points:
    18
    Location:
    PK
    cPanel Access Level:
    DataCenter Provider
    Exim log can be access via SSH as root user at the path /var/log/exim_mainlog. If you are not sure, ask your host to check this for you.
     
  7. tamer1009

    tamer1009 Member

    Joined:
    Apr 1, 2010
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    this is the log:

    2010-04-02 14:15:23 1NxfmV-0000Sy-Qg <= <> R=1NxfmI-0000RO-5y U=mailnull P=local S=3023
    2010-04-02 14:15:23 1NxfmI-0000RO-5y Completed
    2010-04-02 14:15:24 1NxfmV-0000Sy-Qg => btevolut <email@email.com> R=lo caluser T=local_delivery
    2010-04-02 14:15:24 1NxfmV-0000Sy-Qg Completed
    2010-04-02 14:20:15 1NxfrD-0003a5-MV <= email@email.com U=btevolut P=lo cal S=1130 id=d5e8cd81585509b0b7e90fac20794f8e@email.com
    2010-04-02 14:20:27 1NxfrD-0003a5-MV ** email@email.com R=lookuphost T=remote_smtp: SMTP error from remote mail server after RCPT TO:<anastasiocanoni email@email.com>: host smtp.aliceposta.it [85.33.2.53]: 550 5.7.1 [ip] has been blocked by abuseat
    2010-04-02 14:20:27 1NxfrP-0003cH-58 <= <> R=1NxfrD-0003a5-MV U=mailnull P=local S=2122
    2010-04-02 14:20:27 1NxfrD-0003a5-MV Completed
    2010-04-02 14:20:27 1NxfrP-0003cH-58 => btevolut <email@email.com> R=lo caluser T=local_delivery
    2010-04-02 14:20:27 1NxfrP-0003cH-58 Completed

    when i execute a php mail script, it says it has been send but the mail never arrives :S

    before i had cpanel on my vps, i had kloxo and kloxo comes with Qmail, that worked great for me.

    more help would be appreciated :)

    Thanks
     
    #7 tamer1009, Apr 2, 2010
    Last edited: Apr 2, 2010
  8. madaboutlinux

    madaboutlinux Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    1,052
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Earth
    Is 79.xxx.xxx.xxx your server? If yes, see the logs, your IP has been blocked by "abuseat". The IP is black listed at CBL and Spamhaus-ZEN.

    You need to contact them and get your IP removed from their list. Once the IP is removed from the blacklist, emails will start working fine.
     
    #8 madaboutlinux, Apr 2, 2010
    Last edited: Apr 2, 2010
  9. tamer1009

    tamer1009 Member

    Joined:
    Apr 1, 2010
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    thanks for your help al!

    i removed my ip from that list, but it will take a few hours.

    then i will check if it worked :)

    btw: can you please remove my ip for security reasons?

    thanks
     
  10. madaboutlinux

    madaboutlinux Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    1,052
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Earth
Loading...

Share This Page