Solved

sendmail php.ini

Posted on 2004-10-14
5
6,890 Views
Last Modified: 2008-01-09
Guys,

I googled the web all over, but nothing works. Here is my situation:

setting up website at first on my machine Winxp

php + apache

getting this
Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing in c:\documents and settings\purmar\my documents\public_html\hrform\hr_form.php on line 132

my php.ini:
; For Win32 only.
SMTP = crhgy.frf.net
smtp_port = 25

; For Win32 only.
sendmail_from = purmar@crhgy.com

the thing is that phpinfo has  this values:

sendmail_from no value no value
sendmail_path no value no value

and

Configuration File (php.ini) Path  C:\WINDOWS  

there is no php.ini in windows, or in windows/system32

so I put php.ini all over and it still shows no value for sendmail in phpinfo.

can somebody tell me why this does not work and why info shows path to c:\windows when there isn't one and if is, then the values are not correct ...

thanks

purmar

0
Comment
Question by:purmar
  • 2
  • 2
5 Comments
 
LVL 12

Expert Comment

by:minichicken
Comment Utility
Hi Pumar

First of all, the PHP.INI file should be in your C:\Windows and it a hidden file, so what you need to do is open windows explorer, TOOLS >> FOLDER OPTION >> VIEW tab >> enable Show hidden files and folders

and then you should be able to see the PHP.INI file in your Windows folder.

Open PHP.INI in an text editor. And set your SMTP server (You can use the one that you use for your domain that is provided by your hosting company) e.g. SMTP = smtp.mail_server.com
and for sendmail_from  you can set what email address you like, as demostrated below

***************************************************
[mail function]
; For Win32 only.
SMTP = smtp.mail_server.com

; For Win32 only.
sendmail_from = me@example.com


Hope this works for you.....
0
 
LVL 48

Expert Comment

by:hernst42
Comment Utility
Have you restarted your webserver after you copied your php.ini to the c:\windows directory?? The settings will only take effect after the restart of the webserver.
0
 

Author Comment

by:purmar
Comment Utility
Minichicken: as I indicated above I did set up SMTP.  I got the seting from our network guy at work. It should be OK. Also, the sendmail from is set up for my email.
I think that I do have hidden files enabled, but will have to check (I am at home now).  However, as I wrote above, I copied the PHP.INI to windows.  I think that it would scream if it would overwrite the old one, even hidden (right?). As I mentioned I searched google and found even path to windows\system32 so I put there copy as well. Still, the phpinfo says that there is no senmail_from, no smtp and location of PHP.ini is in windows. That only is true, but with all the settings set up (SMTP, sendmail_from).

hernst42: I did restart webserver many times and no result...

thanks

purmar
0
 
LVL 48

Accepted Solution

by:
hernst42 earned 80 total points
Comment Utility
Does in the phpversion-output the path to the php.ini is shown (including the php.ini) like c:\WINDOWS\php.ini

If not, then php-was not able to load that php.ini

To track that down load filemon from http://www.sysinternals.com/ntw2k/source/filemon.shtml start fielmon and restart the webserver. Then you will be able to see for which files are search and you might find the right place to put your php.ini


0
 

Author Comment

by:purmar
Comment Utility
Thank you.  It was looking in apache server directory at first, then windows. I put it again in windows and now it works!!!  Not sure why the old file did not work.  

purmar
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now