Solved

sendmail php.ini

Posted on 2004-10-14
5
6,893 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
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 80 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

786 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