I have some stock code from a book I'm reading. I'll include the code if you want, but I don't believe the problem is with the code. I'm running Apache/MySQL/PHP on a Win98 computer behind a Netgear firewall. I've tried several different ways to send an email by changing the php.ini file but to no avail.
Here are my settings:
[mail function]
; For Win32 only.
SMTP = smtp.earthlink.net
; For Win32 only.
sendmail_from = [email]greer_matt@hotmail.com[/email]
I have a simple form that goes to a PHP script that is supposed to send the email. The form goes just fine and the PHP displays what was entered into the form. Here's the code, just for grins:
Form Code:
<html><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>
send_simpleform.php
<?
if (($_POST[sender_name] == "") && ($_POST[sender_email] == "") && ($_POST[message] == "")) {
header("Location: [url]http://127.0.0.1/simple_form.html[/url]");
exit;
}
$msg = "E-MAIL SENT FROM WWW SITE\n";
$msg .= "Sender's Name: $_POST[sender_name]\n";
$msg .= "Sender's E-Mail: $_POST[sender_email]\n";
$msg .= "Message: $_POST[message]\n\n";
$to = "greer_matt@hotmail.com";
$subject = "Web Site Feedback";
$mailheaders = "From: My Web Site <> \n";
$mailheaders .= "Reply-To: $_POST[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 "$_POST[sender_name]"; ?>
<P><strong>Your E-Mail Address:</strong><br>
<? echo "$_POST[sender_email]"; ?>
<P><strong>Message:</strong><br>
<? echo "$_POST[message]"; ?>
</BODY></HTML>
Simply put, the email is never received through in my hotmail account. I tried using my earthlink email address in the "sendmail_from" field but it didn't work either.
I guess I'm wondering if I need to enter a password to use earthlink's smtp server. I assume that I would, and if so, how would I do this?