469,330 Members | 1,373 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,330 developers. It's quick & easy.

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 32230
"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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by toufik toufik | last post: by
4 posts views Thread by Nick Mudge | last post: by
3 posts views Thread by Karuna | last post: by
reply views Thread by Balakrsihna | last post: by
6 posts views Thread by Geoff Berrow | last post: by
6 posts views Thread by Karl Groves | last post: by
2 posts views Thread by upendrajpr | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Purva khokhar | last post: by
reply views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.