RE: Win32 PHP, Apache Web Server, and Mail
| From: | Mihai Matei | Date: | Mon, 12 Mar 2001 20:48:26 +0000 |
| Subject: | RE: Win32 PHP, Apache Web Server, and Mail | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-5979@lists.php.net to get a copy of this message | ||
Hi.
I had the same problem. All the settings were right but the mail() function still didn't
worked. Finally I used a SMTP server on my machine. If the SMTP server is on the same machine as the
web server (apache in my case) the mail() function works fine. If somebody has another solution for
this problem, I, also be glad to hear it.
>Dear Friends,
>I have tried to be as specific I could according to the little knowledge I
>have in PHP, I have some problem to completing the task, I have read as much
>I could about that and having the same problem Adrian Gould have, to the
>exception that Apache run. Please find below all I have prepare if somebody
>have some clued why I will be more than grateful. As you will see the script
>works to retrieve the information input but did not send the message. I
>could ping the smtp so I have completely froze here.
>
>Thanks Giro
><-----------------------------Results I got after send the
>form---------------------------->
><br>
><b>Warning</b>: Server Error in <b>c:\program files\apache
>group\apache\htdocs\send_simpleform.php</b> on line <b>13</b><br>
><html>
><head>
><title>Simple Feedback Form Sent</title>
></head>
><body>
><h1>The Following e-mail has been sent:</h1>
><P><strong>Your Name:</strong><br>
>giro de roover
><P><strong>Your E-Mail Address:</strong><br>
>gderoover@starband.net
><P><strong>Message:</strong><br>
>PHP is supposed to be cool!!!
></body>
></html>
>
><-----------PHP.ini--------------------->
>
>[mail function]
>SMTP = smtp.starband.net ;for win32
>only
>sendmail_from = gderoover@starband.net ;for win32 only
>
><--------send_simpleform.php------------->
><?php
>$msg = "E-MAIL SENT FROM WWW SITE\n";
>$msg .= "Sender's Name:\t$sender_name\n";
>$msg .= "Sender's E-Mail:\t$sender_email\n";
>$msg .= "Message:\t$message\n\n";
>$to = "gderoover@starband.net";
>$subject = "Web Site Feedback";
>$mailheaders = "From: My Web Site <> \n";
>$mailheaders .= "Reply-To: $sender_email\n\n";
>mail($to, $subject, $msg, $mailheaders);
>?>
><html>
><head>
><title>Simple Feedback Form Sent</title>
></head>
><body>
><h1>The Following e-mail has been sent:</h1>
><P><strong>Your Name:</strong><br>
><? echo "$sender_name"; ?>
><P><strong>Your E-Mail Address:</strong><br>
><? echo "$sender_email"; ?>
><P><strong>Message:</strong><br>
><? echo "$message"; ?>
></body>
></html>
>
><----------------simple_form.html------------------------>
><html>
><head>
><title>Simple Feedback Form</title>
></head>
><body>
>
><form method="post" action="send_simpleform.php">
>
><p><strong>Your Name:</strong><br>
><input type="text" name="sender_name" size=30></P>
>
><p><strong>Your Email Address:</strong><br>
><input type="text" name="sender_email" size=30></P>
>
><p><strong>Message:</strong><br>
><textarea name="message" cols=30 rows=5 wrap=virtual></textarea></p>
>
><P><input type="submit" name="submit" value="Send This
>Form"></P>
>
></form></body></html>