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.

Can't send mail using PHP

Discussion in 'E-mail Discussions' started by dlewis23, Jan 16, 2012.

  1. dlewis23

    dlewis23 Member

    Joined:
    Jan 11, 2007
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    I'm having a problem on a new server where I am unable to send any email using php to any domains that are not on my server.

    I'm using a very simple script to test it:

    PHP:
    <?php 
    mail
    ("some@email.com""Test Email""Hello!!!");
    ?>
    If I try and send email to anything like an @gmail or @yahoo address for example I get nothing, but if I send a email to a domain thats on my server I will receive it just fine.

    Looking through the logs it says they are being sent. Does anyone have any suggests for me?
     
  2. 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
    What does the log entry show precisely for one that isn't sending out?
     
  3. dlewis23

    dlewis23 Member

    Joined:
    Jan 11, 2007
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    It says this:

     
  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
    Could you pick a new email address to test the script with so we can see the original error it would show? The issue right now is that this message is in the retry timeout phase and not showing the original error message that caused it to be delayed and retry.
     
  5. dlewis23

    dlewis23 Member

    Joined:
    Jan 11, 2007
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    cPanelTristan,

    I just tried it with a new email address, and I didn't get anything when I sent it, but there is also nothing in the log for it either.
     
  6. 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
    Without a log entry, it is very difficult to say why it wouldn't be working. At that point, it isn't exim but PHP that would have to be the issue, since it didn't even get to exim to log.
     
  7. ruzbehraja

    ruzbehraja Well-Known Member

    Joined:
    May 19, 2011
    Messages:
    383
    Likes Received:
    7
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Is the user nobody allowed to relay mails?

    WHM >> Tweak Settings >> Mails

    Are the mails showing up in WHM >> Mail queue manager?

    Are the mails showing up in WHM >> View Relayers?
     
  8. storminternet

    storminternet Well-Known Member

    Joined:
    Nov 2, 2011
    Messages:
    462
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Are you able to send email from webmail or outlook to those email addresses for which you are using php script.
    If the emails are working then ensure that you have not disabled php mail (). You can enable it from WHM > Tweak settings > Prevent “nobody” from sending mail > Off
     
Loading...

Share This Page