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 email script worked from my previous server, not this one

Discussion in 'E-mail Discussions' started by Lawrence89, Jan 31, 2008.

  1. Lawrence89

    Lawrence89 Registered

    Jan 31, 2008
    Likes Received:
    Trophy Points:
    I am an intern working on a popcap game. Using popcap's httptransfer class, I am sending up a URL to my website's php script, something like ""

    The PHP script is about as simple as they get:
    if (isset($_REQUEST['email']))
    //send email
    $email = $_REQUEST['email'] ;
    $emailfrom = $_REQUEST['emailfrom'];
    $subject = $_REQUEST['subject'] ;
    $message = $_REQUEST['message'] ;
    mail( $email, "Subject: $subject",
    $message, "From: $emailfrom" );
    echo "Thank you for using our mail form";
    echo "<form method='post' action='mailform.php'>
    Email: <input name='email' type='text' /><br />
    Subject: <input name='subject' type='text' /><br />
    Message:<br />
    <textarea name='message' rows='15' cols='40'>
    </textarea><br />
    <input type='submit' />

    This was working fine from my personal web site, where I wrote it while I waited for the boss to give me the game website's login info. Initially, PHP wasn't installed and that was the issue. Now it's installed, but the email is just not being sent. I'd appreciate any help or direction. I've been reading a lot of the email threads in this forum, but I haven't found any addressing this issue and most are over my head.
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Nov 29, 2006
    Likes Received:
    Trophy Points:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    In a cPanel/WHM environment, a common cause of this would be to block user nobody from sending email, but not setting PHP to run as SuPHP (or if its being run as via CGI, SuExec) and thus the script still runs as nobody (who cannot send mail).

    Note, you may wish to password protect this script or perform some sort of security on this script as this can be very easily used to send spam if left as-is.

Share This Page