Re: configuring sever to send mail (Win2k)
| From: | CJ | Date: | Sat, 05 Jan 2002 05:58:20 +0000 |
| Subject: | Re: configuring sever to send mail (Win2k) | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-79514@lists.php.net to get a copy of this message | ||
thanks for the reply but i still need some help:
PHP Version 4.0.6
--------------------------------
[mail function]
; For Win32 only.
SMTP = localhost
; For Win32 only.
sendmail_from = me@localhost.com
-------------------------------------------
I get this error when i use the mail function on my local server (IIS 5.0,
windows 2000 Pro). Maybe it's an IIS configuration problem. i'm really not
sure.
Error
Warning: Server Error in F:\Inetpub\wwwroot\stowe\scripts\mail.php on line
42
Code
<?php
$to = 'calistusj@hotmail.com';
$from = 'calistuj@hotmail.com';
//Check if we have something POSTed by the form.
if (isset($HTTP_POST_VARS)){
//Start with an empty body for the mail message
$body = '';
//Iterate through all the POSTed variables, and add them to the
message body.
while (list($key, $value) = each($HTTP_POST_VARS)){
$body .= $key . ' = ' . $value . "\r\n";
}
//Build up some nice From/Reply Headers
$headers = "From: $from\r\n";
$headers .= "Reply-To: $from\r\n";
//Mail the message out.
//Requires setting php3.ini sendmail path as per instructions
$success = mail($to, "Posted " . date("m/d/Y"), $body,
$headers); //LINE 42
//Always check return codes from functions.
if ($success){
echo "<B><CENTER>Thank you for your
input</CENTER></B>\n";
}
else{
echo "<CENTER><B>Internal Error</B>: Your input was
unprocessed.<BR>Contact $from</CENTER>\n";
}
}
?>
"Dl Neil" <PHPml@DandE.HomeChoice.co.uk> wrote in message
news:06f601c1962f$e3841cc0$7b16100a@jrbrown...
> CJ,
>
> > i have a problem using the mail function on my server.
> > win2000 Pro
> > IIS 5.0
> > PHP Version 4.0.6
> >
> > i'm not sure if it's a configuration problem with IIS or i'm missing
> > something in the php.ini file.
>
>
> The pre-requisite is that the php.ini file points to a visible SMTP
server. Please review the [mail function]
> section of that file.
> If you have further questions please include that section, plus PHP
version number in your reply.
>
> Regards,
> =dn
>
>