php.ini smtp problem

I currently just installed PHP5 on IIS6 and having a problem with SMTP settings.  I edited my php.ini file in the PHP root dir.  I changed the SMTP server from localhost to the smtp server of my ISP.  I know that it doen't require auth and uses port 25.  After editing that, I restarted IIS.  After filling out the form on the webpage, i still receive the same error:
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in

Apparently, it is still trying to use localhost as the mail server.  Can anyone tell me why???
SteveMat11Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

hernst42Commented:
> I edited my php.ini file in the PHP root dir.
This is not the php.ini IIS uses. Create an file with
<?php phpinfo();
Open that page via brwoser and check for:
Loaded Configuration File
Configuration File (php.ini) Path
and edit that file in that directory. Then restart IIS
0
SteveMat11Author Commented:
It shows it in C:/windows, i went to that dir and do not see php.ini there.
0
SteveMat11Author Commented:
line below that shows: Loaded Configuration File  (none)  
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

hernst42Commented:
So copy your php.ini in from the php-root dir to c:\windows and restart IIS and try again.
0
SteveMat11Author Commented:
Ok, that worked but now i get another error.  Code for the form is attached first, as well as the action page below it.  The error currently reads failed to send removal request.  Like I said, this code worked fine on an apache server.  Any ideas?  Thanks for your help
<html>
<head>
<title>Remove Me From A Class</title>
</head>
<body>
<form method="POST" action="remove_me.php">
<table border="0" cellspacing="5" cellpadding="5">
<tr>
<td>Name:</td><td><input type="text" name="name" size="25" /></td>
</tr>
<tr>
<td>Badge #:</td><td><input type="text" name="badge" size="25" maxlength="3" /></td>
</tr>
<tr>
<td>Class Name:</td><td><input type="text" name="className" size="25" /></td>
</tr>
<tr>
<td>Class Date:</td><td><input type="text" name="date" size="25" /></td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="submit" value="Submit Request" />&nbsp;<input type="reset" name="reset" value="Reset" /></td>
</tr>
</table>
</form>
</body>
</html>
 
 
 
 
 
--------------
 
<?php
$name = $_POST["name"];
$badge = $_POST["badge"];
$className = $_POST["className"];
$date = $_POST["date"];
$to = "***MYEMAIL@MYEMAIL.COM***";
$subject = "Class Remove Request";
$message = "$name\n$badge\n$className\n$date";
 
if (empty($name) || empty($badge) || empty($className) || empty($date)) {
echo "Please Fill In All The Fields. <a href=\"removeme.php\">Back</a>";
}
else if (!empty($name) && !empty($badge) && !empty($className) && !empty($date)) {
 
	if (mail($to, $subject, $message)) {
	echo "Request Successfully Sent";
	}
	else {
	echo "Failed to send Removal Request";
	}
}
?>

Open in new window

0
hernst42Commented:
Maybe your webserver is not allowd to deliver mails to that server. Ask the administrator of the mail-server to check the log or allow your webserver to deliver mails without authentication to that mailserver.
0
SteveMat11Author Commented:
that is the address of our isp's mail server.  I am usually able to send mail through their server without a problem or authentication.  I require auth on my own server.  Any other ideas or address of a mail host that doesnt require auth?
0
hernst42Commented:
Use a mailing class like http://phpmailer.sf.net or http://swiftmailer.sf.net which will produce better error messages if a mail could not get delivered.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SteveMat11Author Commented:
I will change my php.ini file to include that smtp server.  Also, does the "from" email address in the line below that matter?
0
SteveMat11Author Commented:
This actually worked.  I change the code around instead of using home made code.  
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.