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.

unable to send email

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

  1. nick1

    nick1 Member

    Joined:
    May 21, 2006
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    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,279
    Likes Received:
    8
    Trophy Points:
    38
    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