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 Sendmail Problem

Discussion in 'E-mail Discussions' started by celliott, Jan 6, 2006.

  1. celliott

    celliott Well-Known Member

    Joined:
    Jan 2, 2006
    Messages:
    460
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    United Kingdom
    Ever since PHP 4.4.1. I have this script which customers are having problems with.

    A form posts variables to a php file which is sent to via sendmail command.

    The email gets there but the information put into the email from the form does not. I know there is a fix for this as my old host managed it.

    Any ideas?
     
  2. spector

    spector Well-Known Member

    Joined:
    Jun 27, 2005
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    6
    thats probably has nothing to do with sendmail. php code you're using stopped feeding proper data to mail() (in php) command probably due to some other incompatibility reasons. anyway use proper mail() syntax in your software

    <?
    mail('to@domain.com','subject','here goes message','From: someone@domain.com');
    ?>
     
  3. celliott

    celliott Well-Known Member

    Joined:
    Jan 2, 2006
    Messages:
    460
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    United Kingdom
    OK. But I know there is a solution to this server side as this was done by my old host.

    In the email I have several bits of information which is gathered from the form. There is nothing wrong with the code as it worked fine before, and here is the bit which sends which is identical to yours.

    mail("email@idontlikespam", $subject, $message, $from);
     
  4. MMarko

    MMarko Well-Known Member

    Joined:
    Apr 18, 2005
    Messages:
    316
    Likes Received:
    0
    Trophy Points:
    16
    Maybe register_globals in turned off so scripts that are not written ok might have problems. You have to acccess variables and values with _GET["var_name"]

    I had problems with that recently.
     
  5. celliott

    celliott Well-Known Member

    Joined:
    Jan 2, 2006
    Messages:
    460
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    United Kingdom
    Could turning on register_globals help this?
     
  6. celliott

    celliott Well-Known Member

    Joined:
    Jan 2, 2006
    Messages:
    460
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    United Kingdom
    Anyone? I really need a fix for this.
     
  7. x2o

    x2o Member

    Joined:
    May 11, 2005
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    I'm having a problem with this for basic php and was told turning this on would help fix this so I guess that would be a yes.

    Not sure how to do it yet though.

    Thanks
    x2o
     
  8. Izzee

    Izzee Well-Known Member

    Joined:
    Feb 6, 2004
    Messages:
    469
    Likes Received:
    0
    Trophy Points:
    16
    If you have root access then edit your master php.ini file.

    To locate your master php.ini file create a file called phpinfo.php.ini with only this code in it:
    Code:
    <?php
     phpinfo();
    ?>
    Then upload to the public_html directory of the account the scripts are being called from.
    It will feed back all the php.ini config details. Call the phpinfo.php file from your browser.

    Edit this master php.ini file and change the directive register_globals = On if it set to Off.

    There are some implications with having this set On in a shared hosting environment so do a search on this issue. You can set it to individual account's scripts use though on a per user basis. Follow this:

    If no root access then create a .htaccess file and place in the same directory the scripts are being called from, with this directive in it.
    Code:
    php_value register_globals 1
    If phpSuExec is compiled in php then you use a php.ini file instead of a .htaccess file in the called scripts directory with this in it:
    Code:
    register_globals = On
    You can't use .htaccess for this if phpSuExec is used you have to use a php.ini file.

    :)
     
    #8 Izzee, Jan 7, 2006
    Last edited: Jan 7, 2006
Loading...

Share This Page