Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

unable to send email

Discussion in 'E-mail Discussion' started by nick1, May 17, 2008.

  1. nick1

    nick1 Member

    Joined:
    May 21, 2006
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    151
    Hello,

    I am unable to send email via PHP script. The codes I am using are:

    <?php
    $to = "user@domain.com";
    $subject = "Hi!";
    $body = "Hi,\n\nHow are you?";
    mail($to, $subject, $body)
    ?>

    However, when I executed these code on console it works.

    Please help

    Thanks in advance
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,216
    Likes Received:
    10
    Trophy Points:
    313
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Two things to check:
    1. Are you running SuPHP (or SuExec with PHP running as a CGI)?
    2. Are you preventing user nobody from sending mail?

    if you are preventing user nobody from sending mail, but are not running SuPHP/SuExec, then that could explain this behavior.
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice