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 mail not working

Discussion in 'E-mail Discussions' started by phil2021, Dec 3, 2008.

  1. phil2021

    phil2021 Registered

    Joined:
    Dec 3, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Hello all

    I have recently set up a virtual server and all has gone well except that I can not seem to send any mail via php applications running on the my server.

    Is there a setting on php5 that I need to enable? I have asked around and it was suggested I look at the php.ini file but to be honest I don't know how to work at that level.

    Some one else suggested to look at the mail route, but again I have no idea where to find that and what to set it too if I did.

    Any suggestions
     
  2. thewebhosting

    thewebhosting Well-Known Member

    Joined:
    May 9, 2008
    Messages:
    1,201
    Likes Received:
    1
    Trophy Points:
    38
    Which function of PHP are you using to send your emails? If you are using phpmailer() then please make sure that you have installed all the required class files of phpmailer().
     
  3. phil2021

    phil2021 Registered

    Joined:
    Dec 3, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    thanks for the advise

    Since this is a mailing application I am assuming that it is useing phpmailer. how do I ensure the files have been installed?
     
  4. apscinsspl

    apscinsspl Well-Known Member

    Joined:
    Mar 15, 2008
    Messages:
    112
    Likes Received:
    0
    Trophy Points:
    16
    Hello,

    I think you should check if the server is phpsuexec enabled, if so then the nobody user cant sent mail via PHP script. Secondly if the server is not phpsuexec enabled then you have to check in tweak settings that user nobody is allowed to send mails. This will fix the issue.
     
  5. thewebhosting

    thewebhosting Well-Known Member

    Joined:
    May 9, 2008
    Messages:
    1,201
    Likes Received:
    1
    Trophy Points:
    38
    Can you tell me how can we check if phpsuEXEC is disabled or enabled?

    I think it is from WHM-> configure PHP and suEXEC, am I right?

    Plz correct me if I am wrong!
     
  6. apscinsspl

    apscinsspl Well-Known Member

    Joined:
    Mar 15, 2008
    Messages:
    112
    Likes Received:
    0
    Trophy Points:
    16
    Hello,

    Yes thewebhosting

    you are correct, the option is:

    WHM-> configure PHP and suEXEC
     
  7. grindlay

    grindlay Active Member

    Joined:
    Dec 8, 2004
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Edinburgh, Scotland
    cPanel Access Level:
    Root Administrator
    phpMailer Send (SMTP) problems

    Not sure if this is a new problem introduced with the recent update to the PHP SMTP libraries, but today I found that my phpMailer scripts were failing.

    After the usual hacking about for two or three hours, I was able to isolate the problem and I'm posting it here in case it helps anyone.

    In my original scripts I had :

    $mail = new PHPMailer();
    $mail->IsSMTP();
    $mail->Host = "mail.mydomain.com";
    $mail->SMTPAuth = true;
    $mail->Username = "properuser@mydomain.com";
    $mail->Password = "proper_user_pass";

    This worked until today. The clue was that the same script worked on my local Windows/Apache machine but not on my server.

    I substituted :

    $mail->Host = "127.0.0.1";

    And all was well again.
    This assumes that you are using your own SMTP server to send out i.e. the SMTP server on the box that you are hosting the script from. If you are connecting to a remote SMTP server and relaying, then the above is irrelevent and sorry to have wasted your time :D
     
Loading...

Share This Page