Quantcast
Channel: All Forums
Viewing all articles
Browse latest Browse all 27852

PHP and SMTP Errors on Windows 2008 r2, IIS 7

$
0
0

I have a Windows 2008 r2 server with PHP and SMTP installed and functioning individually, but when PHP attempts to send emails it generates errors in the logs(the script itself executes "successfully" as it returns a success message, but no emails are sent)

SMTP has be verified to work and I have sent out a few emails successfully with it by manually placing files in the mailroot Pickup folder. It sends these email files no problem and generates logs as well.

When running the PHP script it generates no logs in the SMTP virtual server but it does generate this log in php53_errors.log:

""[09-Aug-2012 05:53:54 UTC] PHP Warning: 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 C:\inetpub\wwwroot\mailform.php on line 17""

I have set php.ini to the appropriate settings(SMTP is running on localhost and port 25) and I also have tried running the script with the proper settings defined in ini_set(). In both cases the same error is generated

Here is my script code:

"<?php

$to = "empemitheos@yahoo.com";
$subject = "Hey";
$message = "Hello! testing this thing.";
$from = "
contact@koy-design.com";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
echo "Mail Sent.";

?>"

I installed PHP 5.3.13 via Microsoft's automatic installer. Any ideas what the problem could be? Thanks!


Viewing all articles
Browse latest Browse all 27852

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>