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.

problem with php mail() function

Discussion in 'E-mail Discussions' started by ivsdigitel, Sep 25, 2005.

  1. ivsdigitel

    ivsdigitel Registered

    Joined:
    Sep 25, 2005
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Serbia
    Hello everyone,
    I have one problem,
    i am using this php script:

    <?php
    $header = 'From: wapadds@wapadds.com' . "rn" .
    'Reply-To: wapadds@wapadds.com' . "rn" .
    'X-Mailer: PHP/' . phpversion();
    mail("ivs@gsmdigitel.com" , "something", "please work", $header);
    echo "like ok";
    ?>

    the problem is that script works when i put any local e-mail (e-mail which is on the same server as script), but when i put a remote e-mail address it does not work, i have no idea what can cause this problem.

    I have:
    os: CentOS 4.1 i686
    cp: WHM 10.6.0 cPanel 10.8.0-R8

    Thanks
     
  2. flash7

    flash7 Well-Known Member

    Joined:
    Feb 16, 2004
    Messages:
    203
    Likes Received:
    0
    Trophy Points:
    16
    Use "\r\n" instead of "rn"
     
  3. ivsdigitel

    ivsdigitel Registered

    Joined:
    Sep 25, 2005
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Serbia
    i solved the problem:

    there is an option in "Main >> Server Configuration >> Tweak Settings "
    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.)

    Thanks
     
  4. Manuel_accu

    Manuel_accu Well-Known Member

    Joined:
    Jun 19, 2005
    Messages:
    191
    Likes Received:
    0
    Trophy Points:
    16
    But there are many conflication while using hpsuexec and suexec. Is there any other option for that?

    Thanks,
     
Loading...

Share This Page