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 function mail () not working within my account

Discussion in 'E-mail Discussions' started by chike, Sep 19, 2009.

  1. chike

    chike Member

    Joined:
    Sep 19, 2009
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    hello everyone,

    i am new to web hosting and the first reseller account i bought is giving me a hell of headeache.

    i found out that the pages i uploaded in my public_html folder and that of the clients i hosted on my reseller account have a problem with the php mail () function. the function just does not work.

    i use php form to email scripts a lot, and in all of my other hosting accounts, i use form to email scripts, but since over a month ago that i bought a reseller hosting account from one hosting company here in nigeria, my scripts all of a sudden are no longer working - they just do not send any emails.

    pls do u know what i should do?

    i have been emailing the company that sold the reseller account to me but they seem not to know what to do about the problem.

    pls help me out if you could.

    :confused:
     
  2. thewebhosting

    thewebhosting Well-Known Member

    Joined:
    May 9, 2008
    Messages:
    1,201
    Likes Received:
    1
    Trophy Points:
    38
    PHP mail() function does not require SMTP authentication to send emails from server. Hence, most of the hosting providers disables it due to security reasons.

    You can use SMTP authenticated script instead like phpmailer().
     
  3. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    It is quite possible that they don't know what's wrong! :rolsleyes:

    You would be surprised how many "hosts" out there don't know even the basics.

    I would need to know more about their configuration and then could probably tell you specifically what is wrong within just a couple of seconds.

    Some of the more common possibilities include:


    • Restricting access for user nobody when PHP is not SuPHP
    • Disabling mail() function
    • Disabled or misconfigured mail server / Configuration
    • Firewall setup incorrectly or has the wrong ports closed
    • Other file permission or configuration issues
     
    #3 Spiral, Sep 20, 2009
    Last edited: Sep 20, 2009
  4. linux7802

    linux7802 Well-Known Member

    Joined:
    Dec 14, 2007
    Messages:
    232
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Solution

    As per your query it seems to be that your hosting provider not allowing to use phpmail() function to send an E-mail.I would like to recommend you first check whether your script having problem or its really phpmail() function issue with your hosting provider.Test phpmail() with the test form by using following URL and contact your hosting provider if you are still having any problem to send an E-mail.

    The Perfect Forum / Blog ..What you think? » Blog Archive » Send mail by using phpmail function.

    Hope it will resolve your issue .....:)
     
  5. chike

    chike Member

    Joined:
    Sep 19, 2009
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    Thanks Everyone!

    I want to thank you all for taking out time to help me.

    Meanwhile, here's the reply i got from the hosting company yesterday:-

    "Sir,

    The PHP settings you are asking for allows people to send mails through
    the server without proper identification thus we do not allow the
    settings.

    You need to use SMTP in sending mail via php scripts.

    Best regards"

    But the problem now is that i do not know what is SMTP nor do i know how to use it.

    Could you still help?

    :confused:
     
  6. chike

    chike Member

    Joined:
    Sep 19, 2009
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    Php.ini

    i just did a little web search on smtp and the whole idea seems a little bit confusing to me especially as regards to the fact the the client i have presently hosted on my reseller account has a forum on his site where he needs to contact his members through email notifications and his members would also get their passwords back through email if they forgot them, and so many other email messaging functions - so i dont know how much smtp would help with this - i have actually emailed the programmer that developed the forum about this.

    is there not a way i could set up my own php.ini file to overwrite the restrictions on the server of the host company?

    and is it really worth it for a hosting company to put emailing restrications like this - considering the fact that three other hosting companies i have dealt with [and still deal with] before i met this last one, do not have any of such restrictions - and one of the companies is ixwebhosting which i understand is indeed a popular company - i send mails freely with php on their server. so i am wondering why all the hollaballoo with this company now. or should i just see if they could refund my money so i can leave them with their troubles and go my way? what do you advise? i do not like unnecessary troubles in my life.

    :confused:
     
    #6 chike, Sep 22, 2009
    Last edited: Sep 22, 2009
  7. sanjaydagar123

    Joined:
    Aug 29, 2009
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    delhi, india
    first of all check your form script. you can use the follwing links to check your script.

    useful links:
    PHP: mail - Manual
    PHP Mail

    after check that, you would face the same problem, then contact your hosting provider to enable it. note that hosting provider may disable php mail function due to security reasons link spamming. if they disabled it, ask for alternate for php mail function.
     
  8. benfaust

    benfaust Member

    Joined:
    Aug 28, 2006
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Say Goodbye

    I'd recommend leaving them. I almost never encounter a hosting service that disables mail(). Just now ran into one -- Yahoo (a psuedo-host, in my opinion). You might want to try HostNine. Their reseller accounts are $19.95 per month, and I've never had any problems with PHP scripts running on their servers.
     
Loading...

Share This Page