Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 6920
  • Last Modified:

sendmail php.ini

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
purmar
Asked:
purmar
  • 2
  • 2
1 Solution
 
minichickenCommented:
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
 
hernst42Commented:
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
 
purmarAuthor Commented:
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
 
hernst42Commented:
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
 
purmarAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now