PHP Mail Function Not Working

jlimited

Well-Known Member
Jun 4, 2004
69
0
156
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
 

jlimited

Well-Known Member
Jun 4, 2004
69
0
156
Does this make since?

2006-04-20 14:15:06 1FWecM-0006fh-5n ** [email protected] 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 == [email protected] <[email protected]> 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 ** [email protected] <[email protected]>: retry timeout exceeded
2006-04-20 14:15:06 1FWecM-0006fj-7v [email protected] <[email protected]>: error ignored
2006-04-20 14:15:06 1FWecM-0006fj-7v Completed
 

jlimited

Well-Known Member
Jun 4, 2004
69
0
156
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 [email protected] 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 <[email protected]>");


Exim_mainlog:

2006-04-28 10:12:43 1FZUeB-0003xb-0N <= [email protected] 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 ** [email protected] R=fail_remote_domains: unrouteable mail domain "northcentral.edu"
2006-04-28 10:12:43 1FZUeB-0003xb-0N Completed
 

sparksupport

Member
Apr 30, 2006
20
0
151
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
 

swiftecit

Member
Jun 30, 2006
7
0
151
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?
 

swiftecit

Member
Jun 30, 2006
7
0
151
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.