Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

not able to send email via mail()

Discussion in 'E-mail Discussion' started by gknischal, Jun 28, 2012.

  1. gknischal

    gknischal Registered

    Joined:
    Jun 28, 2012
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    i am using mail() function to send mail through my website.The mail() function does not give any error but the email is not send to the receivers end.what would be the problem behind it?
     
  2. gknischal

    gknischal Registered

    Joined:
    Jun 28, 2012
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    also i get these error msg in my mail
    "Mail sent by user nobody being discarded due to sender restrictions in WHM->Tweak Settings"
     
  3. NixTree

    NixTree Well-Known Member

    Joined:
    Aug 19, 2010
    Messages:
    407
    Likes Received:
    3
    Trophy Points:
    143
    Location:
    Gods Own Country
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    I think you have PHP running as apache module on your server ( as nobody user ) and enabled "Prevent “nobody” from sending mail" in tweak settings. To enable emailing from PHP script turn off "Prevent “nobody” from sending mail" option under " Main >> Server Configuration >> Tweak Settings ( Mail tab ). You need root access for this. If you don't have root access, ask your host.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,608
    Likes Received:
    32
    Trophy Points:
    238
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    If the user nobody cannot send emails, you should try to use SMTP authentication in the script instead of using mail() function.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. gknischal

    gknischal Registered

    Joined:
    Jun 28, 2012
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Smtp Authentication works!!!
    A new problem arise when i am editing the from address to "xyz@mydomain" the email is not send.
    and any address other than my domain name the mail is perfectly send...
    Does any one know what's the problem.
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice