Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

sendmail php.ini

Posted on 2004-10-14
5
Medium Priority
?
6,907 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 12

Expert Comment

by:minichicken
ID: 12312615
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
ID: 12312821
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
ID: 12313602
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 320 total points
ID: 12314051
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
ID: 12317885
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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

688 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