I am running XAMPP on my local computer and on the server in the office. Both Windows machines.
I am writing code that I use mail()to send email from a form. By default, it uses sendmail.exe(which comes with XAMPP) to send email . In all cases, mail is actually sent through a third computer, which is the Exchange server.
On my local machine, PHP can send mail just fine. On the server, after submitting the form, I get this error:
Warning: mail () [function.mail]: Failed to connect to the mail server in "localhost" 25, check "SMTP" and "smtp___port" in php.ini or use ini_set () in
... then my file name.
I do not understand why it refers to "localhost". Nowhere in php.ini or sendmail.ini "localhost" is used - I use the name of the mail server. The SMTP information used on both machines is the same.
As far as I can tell, in both environments there is everything important:
- Php.ini files are identical
- Sendmail.ini files are identical
- Both machines have the same version of XAMPP installed.
- The same script batches will run on both machines and successfully send email through
sendmail.exe
I stopped and ran Apache several times to make sure it was using updated configuration files.
When I get the error message above, I notice that the sendmail.exe file does not create a log file, which makes me think that it never starts.
What am I missing?
solvable
, , c:\xampp\php\php.ini, c:\xampp\apache\bin\php.ini. , , - .
php_info(), , , . ! .