473,503 Members | 2,066 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error using mail() - sendmail_from not set in php.ini or custom From: missing

Hi,

This is the error:

Warning: mail(): "sendmail_from" not set in php.ini or custom "From:"
header missing in c:\lserver\test\sendform.php on line 10

This is the code:

<?
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;

$from = "From: $email\r\n";

mail( "we*********@myaddress.com", "Question", $message, $from );
?>
This is from php.ini

[mail function]
; For Win32 only.
SMTP = localhost

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

; For Unix only. You may supply arguments as well (default: "sendmail -t -
i").
;sendmail_path =

Using Apache 1.3.28 / PhP 4.3.2 on Windows XP. So far other (simple)
scripts worked fine.

Tried everything. Searched the web, there are more people having this
problem, but couldn't find a solution (nor could they....)
Hope anybody can help, I'm getting crazy.........

Thanks,
Edo.
Jul 17 '05 #1
4 32521
"Edo van der Zouwen" <ezouwen@gebruikershierwetendomeinwel> wrote in message
news:Xn*****************************@216.168.3.44. ..
Hi,

This is the error:

Warning: mail(): "sendmail_from" not set in php.ini or custom "From:"
header missing in c:\lserver\test\sendform.php on line 10

This is the code:

<?
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;

$from = "From: $email\r\n";

mail( "we*********@myaddress.com", "Question", $message, $from );
?>
This is from php.ini

[mail function]
; For Win32 only.
SMTP = localhost

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

; For Unix only. You may supply arguments as well (default: "sendmail -t - i").
;sendmail_path =

Using Apache 1.3.28 / PhP 4.3.2 on Windows XP. So far other (simple)
scripts worked fine.

Tried everything. Searched the web, there are more people having this
problem, but couldn't find a solution (nor could they....)
Hope anybody can help, I'm getting crazy.........

Thanks,
Edo.

read your errors, it's all there.
You need to set the sendmail path in your php.ini file to point to a mail
server.

Regards
Richard Grove
http://redeyemedia.co.uk
http://shopbuilder.org

Jul 17 '05 #2
>
read your errors, it's all there.
You need to set the sendmail path in your php.ini file to point to a
mail server.

Regards
Richard Grove
http://redeyemedia.co.uk
http://shopbuilder.org

That is indeed true under Unix. As mentioned, I'm working under Windows XP.

However, I just found a work around: put php.ini not just in c:\windows
\system32, but also in the php install directory (in my case c:\php).

For some reason this fixed my problem.........
Edo.
Jul 17 '05 #3
>
However, I just found a work around: put php.ini not just in c:\windows
\system32, but also in the php install directory (in my case c:\php).

For some reason this fixed my problem.........


i have similar problem in windows xp and i solve it by putting the
php.ini in c:\windows, can any one explain to me how this happen?

Regard

Jorn
Jul 17 '05 #4
On 31 Jan 2004 21:57:32 -0800, jo****@yahoo.com (jo****@yahoo.com)
wrote:

However, I just found a work around: put php.ini not just in c:\windows
\system32, but also in the php install directory (in my case c:\php).

For some reason this fixed my problem.........


i have similar problem in windows xp and i solve it by putting the
php.ini in c:\windows, can any one explain to me how this happen?

Regard

Jorn

That's funny :)

I followed the php-installation instructions on
http://www.net-language.com/workshop...sp?workshop=21, where I
was instructed to put php.ini in c:\windows\system32 (XP that is), and
to remove it from c:\php..........

Do you have 2 php.ini 's now, or did you delete the one from c:\php?

Cheers,

Edo.
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2583
by: toufik toufik | last post by:
Hi, I'm having the folowing error : Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing in c:\....filename when I try to send a simple email using the folowing...
4
1938
by: Nick Mudge | last post by:
I am trying to use the mail() function in my PHP script, but when I run the script, nothing happens. I am using Windows XP with Apache. I have the current versions of PHP 4, Apache 2, and MySQL....
3
2248
by: Karuna | last post by:
Hi everybody, I have been trying to write a simple mail script using PHP and apache on Windows XP. Eventhough the script is saying that the mail is successfully sent, I am unable get it in my...
3
3289
by: vishal | last post by:
i am getting following error. Warning: mail() : Failed to connect to mailserver at "smtp.gmail.com" port 465, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in...
0
5688
by: Balakrsihna | last post by:
Hi All, Can anyone tell me how to replace an image in MS Word 2003 using c#.net. I am converting an html file to word doc and sending this as attachment using System.Web.Mail; the...
4
3667
by: chris.huh | last post by:
This may not be the best place to put this but i have set up apache as a testing server on my local machine. Whenever i try to use a formmail.php script i downloaded is always come sup saying that...
6
3690
by: Geoff Berrow | last post by:
I'm doing a bit of work for a guy and on his system the mail() function always returns false, but the mail is sent. Anyone come across this? Any ideas what is causing it and how to fix it? --...
6
1955
by: Karl Groves | last post by:
I'm trying to work out a mail system which can send an attachment as well as an HTML formatted message (and a default plain text version). I found some pretty good code on PHP.net and modified it...
2
2050
by: upendrajpr | last post by:
Dear friends I am sending mail from my site but it gives me some error "Warning: mail() : "sendmail_from" not set in php.ini or custom "From:" header missing in C:\P............." my...
0
7205
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7287
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7348
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7006
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
4685
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3166
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.