Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Member
    Join Date
    Jun 2004
    Posts
    69

    Default PHP Mail Function Not Working

    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. #2
    Member
    Join Date
    Jan 2005
    Posts
    1,880

    Default

    You could begin by checking /var/log/exim_mainlog for signs of what is happening.

  3. #3
    Member
    Join Date
    Jun 2004
    Posts
    69

    Default 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. #4
    Member
    Join Date
    Jan 2005
    Posts
    1,880

    Default

    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. #5
    Member
    Join Date
    Jun 2004
    Posts
    69

    Default

    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/?...p=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. #6
    Member
    Join Date
    Apr 2006
    Posts
    20

    Default

    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. #7
    Member
    Join Date
    Jun 2006
    Posts
    7

    Default 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. #8
    Member
    Join Date
    Jun 2006
    Posts
    7

    Default 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.

Similar Threads & Tags
Similar threads

  1. php function mail () not working within my account
    By chike in forum New User Questions
    Replies: 7
    Last Post: 06-07-2010, 02:03 PM
  2. php mail() function not working
    By nowashburn in forum E-mail Discussions
    Replies: 2
    Last Post: 12-11-2008, 09:00 PM
  3. PHP function mail() is not working
    By Secret Agent in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 02-21-2006, 12:12 AM
  4. PHP mail function not working, Nobody user prevented.
    By antodeepak in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 01-25-2006, 09:00 AM
  5. php mail function is not working
    By shann in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 11-23-2002, 04:33 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube