Mail function dont send emails

pilpelet

Verified User
Joined
Oct 12, 2003
Messages
101
Hi to all ,

I have this strange thing , the PHP mail function dont send emails .

I tested it with a simple script :

<?php

$mailTo = "[email protected]";
$msgSubject = "TEST";
$msgBody = "$name, $company, $address, $email_address, $demographics";
$xHeaders = "From: $email_address\nX-Mailer: PHP/" . phpversion();

mail ($mailTo, $msgSubject, $msgBody, $xHeaders);

?>

The code dont produce erorrs but also the email doesnt arrive .


Iv also rebuilted PHP last week in case someone will suggest that .


Thanks for any help .
 
Hi ,

Iv noticed that by running phpinfo it shwoing send mail as the path to the mail program , i figured that it need to be changed to
/usr/sbin/sendmail.exim

I ajusted the /usr/local/lib/php.ini but still no erorr but also mails
doesnt arive .

Im including the 2 mails lined just in case it will help somehow :

---------
sendmail_from [email protected] [email protected]
sendmail_path /usr/sbin/sendmail.exim /usr/sbin/sendmail.exim
----------

Where [email protected] is the how it is didnt changed it .
or should i include a real email .

Thanks ,
 
Hello,

We generally just use /usr/sbin/sendmail ... as it's just a symbolic link to /usr/sbin/exim... I'm not sure if the different name of the other file will affect anything.

John
 
Hi jhon ,

I just figured it out by reading other post regarding that .

So what can i do next . Its odd , mail are not sent using this command .

Regards ,
 
Hello,

That was a while ago, but I *think* (not positive) the sendmail path was set to something different in the /usr/local/lib/php.ini file.. check if it's set to /usr/sbin/sendmail (not actually set to anything as default)

John
 
Jhon ,

Im quite sure that its doesnt have to do with php.ini as the path is ok . Iv noticed in other post regarding that , that you mannge to fix it(same problem) with ajusting exim.conf .

What exactly need to be done here ?

Thanks ,
 
Hello,

1) edit /usr/local/lib/php.ini and comment out any reference to the sendmail path. "/usr/sbin/sendmail -t -i" should be used by default

2) make sure that /usr/sbin/sendmail points to exim, if not run:
ln -sf exim /usr/sbin/sendmail

3) load up a "<? phpinfo(); ?>" page..and scroll down to the "standard" section. It should have "Path to sendmail /usr/sbin/sendmail -t -i", if not, then you'd need to recompile php after you've check step 2.

John
 
Jhon hi ,

I did this 3 steps allready , i think the default path in php.ini
was ...sendmail then i changed it to sendmail.exim but then understood that its not realy matter couse there is a seem link .

Then repompiled PHP anyway just in case . And the problem is still there exim is working PHP mail isnt .

I cant see any resone to recomplie PHP again .

Thanks .
 
Jhon ,

First thanks for carring .
Did the problem fixed ? I tested it and it seems like the same
But 1 user said it works for him so it realy confused me .

Regards ,
 
Hi agian ,

Opps , went thru the last emails , ill try to change the host name
see if it'll help .

Thanks ,
 
Sendmail setup question

Sendmail setup question

Hi,

We have a php program which request for the mail setting as follow:

I can select MAIL or SENDMAIL

and it provided the following message for reference:
""You can choose mails to be sent through the standard PHP mail() function, or through the UNIX Sendmail program.
If you choose to send mails through Sendmail, you have to enter the Sendmail path in the textfield below.""

and the sendmail path is /usr/sbin/sendmail (by default)

I selected "SENDMAIL"


We have make few email test (to my direct admin email, gmail, and others.... it seems ok. (However for all HOTMAIL's Account, they can't received any email!!!)

Can anyone able to solve this?

Thanks~
ricky
 
If hotmail isn't accepting email it's not a problem with your selecting the sendmail option.

Most likely you don't have reverse DNS set up for your server's main IP#.

In most cases your upstream (connectivity) provider has to do this for you.

Jeff
 
Back
Top