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 Function Not Working

Discussion in 'E-mail Discussions' started by jlimited, Apr 20, 2006.

  1. jlimited

    jlimited Well-Known Member

    Joined:
    Jun 4, 2004
    Messages:
    69
    Likes Received:
    0
    Trophy Points:
    6
    Hello,

    I am having some problems sending mail from my server to email accounts that are not hosted on my server. It works fine when I send emails to accounts on the server.

    I am using the PHP Mail function. Does anyone have an idea of where I should start looking?

    Thanks
    Travis
     
  2. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    You could begin by checking /var/log/exim_mainlog for signs of what is happening.
     
  3. jlimited

    jlimited Well-Known Member

    Joined:
    Jun 4, 2004
    Messages:
    69
    Likes Received:
    0
    Trophy Points:
    6
    Does this make since?

    2006-04-20 14:15:06 1FWecM-0006fh-5n ** theman@jeffsauer.com R=fail_remote_domains: unrouteable mail domain "jeffsauer.com"
    2006-04-20 14:15:06 1FWecM-0006fj-7v <= <> R=1FWecM-0006fh-5n U=mailnull P=local S=1747
    2006-04-20 14:15:06 1FWecM-0006fh-5n Completed
    2006-04-20 14:15:06 1FWecM-0006fj-7v User 0 set for local_delivery transport is on the never_users list
    2006-04-20 14:15:06 1FWecM-0006fj-7v == root@server1.limitedwebgroup.com <nobody@server1.limitedwebgroup.com> R=localuser T=local_delivery defer (-29): User 0 set for local_delivery transport is on the never_users list
    2006-04-20 14:15:06 1FWecM-0006fj-7v ** root@server1.limitedwebgroup.com <nobody@server1.limitedwebgroup.com>: retry timeout exceeded
    2006-04-20 14:15:06 1FWecM-0006fj-7v root@server1.limitedwebgroup.com <nobody@server1.limitedwebgroup.com>: error ignored
    2006-04-20 14:15:06 1FWecM-0006fj-7v Completed
     
  4. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    Well, at least you have an error there you can work with.

    Use the advanced search to search the forums for "unrouteable mail domain" (without the quotes), searching titles only instead of whole posts - you'll find lots of threads on the subject!
     
  5. jlimited

    jlimited Well-Known Member

    Joined:
    Jun 4, 2004
    Messages:
    69
    Likes Received:
    0
    Trophy Points:
    6
    I still can not figure this out. It works fine for email sent to limitedwebgroup.com, but emails send to anyone else it does not work. I placed in bold what I think it causing it...but people were using the nobody@server1.limitedwebgroup.com to spam people, so I enable it. How can I modify my code to send email using a different user?

    If I were to add a SPF entry in my DNS would that allow me to uncheck this setting?

    Here is my code.

    $subject = "Email Verification Request";
    $message = "
    Dear $firstname $lastname,

    Domain: $domain.$ext

    Select Package: $package[1]
    Front Page Extenions: $fpyes
    Personal IP Address: $ipyes

    Site's Purpose: $purpose

    Please click on this link to verify these options.

    https://secure.limitedwebgroup.com/?loc=signup&step=verification

    Thank You,
    Limited Web Group's Sales Department";

    mail($primaryemail, $subject, $message, "From: Limited Web Group's Sales Department <sales@limitedwebgroup.com>");


    Exim_mainlog:

    2006-04-28 10:12:43 1FZUeB-0003xb-0N <= nobody@server1.limitedwebgroup.com U=nobody P=local S=716
    2006-04-28 10:12:43 1FZUeB-0003xb-0N failed to expand condition "${perl{checkspam}}" for lookuphost router: Mail sent by user nobody, UID 99, being discarded due to sender restrictions in WHM->Tweak Settings at /etc/exim.pl line 394.
    2006-04-28 10:12:43 1FZUeB-0003xb-0N failed to expand condition "${perl{checkspam}}" for literal router: Mail sent by user nobody, UID 99, being discarded due to sender restrictions in WHM->Tweak Settings at /etc/exim.pl line 394.
    2006-04-28 10:12:43 1FZUeB-0003xb-0N ** travis.gassmann@mail.northcentral.edu R=fail_remote_domains: unrouteable mail domain "northcentral.edu"
    2006-04-28 10:12:43 1FZUeB-0003xb-0N Completed
     
  6. sparksupport

    sparksupport Member

    Joined:
    Apr 30, 2006
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Some methods to send mails using php when mails from nobody is disabled

    1. php as cgi - run the php script from cgi-bin
    2. using smtp - example pear smtp
    3. Best, enable phpsuexec , but initially you have to face some troubles
     
  7. swiftecit

    swiftecit Member

    Joined:
    Jun 30, 2006
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    unroutable domain - using php mail

    hello all,

    we have a php script which sends the user a copy of the information they enter into a form. if the user is on our server - they get their copy (we always get a copy as we are on our server). if their email is anywhere else - the email disappears.

    looking in the logs - I see
    2006-07-08 07:53:00 ..... R=fail_remote_domains: unroutable mail domain "charter.net"

    now charter is huge and the recipient address was valid.

    ideas?
     
  8. swiftecit

    swiftecit Member

    Joined:
    Jun 30, 2006
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    php mail fixed

    I followed the suggestion of:

    deleted the /etc/eximmailtrap file
    changed /var/cpanel/cpanel.config to make eximmailtrap=0

    and this solved the problem.

    thanks.
     
Loading...

Share This Page