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.

not able to send email via mail()

Discussion in 'E-mail Discussions' 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:
    386
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Gods Own Country
    cPanel Access Level:
    Root Administrator
    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.
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    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.
     
  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