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

From: Edo van der Zouwen (ezouwen_at_gebruikershierwetendomeinwel)
Date: 01/31/04


Date: Sat, 31 Jan 2004 11:16:42 -0000

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( "webquestion@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.



Relevant Pages

  • PHP MAIL on Apache and Windows Server 2003
    ... I am at my wits end here, I am trying to get PHP's mail function send ... We are running the SMTP sever under Windows and are running PHP ... ; For Win32 only. ... echo "Email Has Been Sent ."; ...
    (php.general)
  • Re: PHP Mail
    ... ; For Win32 only. ... SMTP = localhost ... do you have the smtp server installed or are you running exchange? ...
    (microsoft.public.inetserver.iis.smtp_nntp)
  • PHP Mail
    ... ; For Win32 only. ... SMTP = localhost ...
    (microsoft.public.inetserver.iis.smtp_nntp)
  • Re: PHP SMTP SERVICE
    ... php.ini file, search for SMTP. ... ; For Win32 only. ... change the word localhost to your desired SMTP server address. ...
    (php.general)
  • Re: mail function error
    ... ; For Win32 only. ... Why is he trying to connect to localhost? ... Did you restart apache? ...
    (alt.php)