Forum Moderators: coopster

Message Too Old, No Replies

i can't mail() from IIS/SMTP

can we send mail() from localhost IIS to other domain?

         

anshul

8:26 am on Aug 4, 2004 (gmt 0)

10+ Year Member



i always get this error when i use
<?php
mail("joecool@example.com", "My Subject", "Line 1\nLine 2\nLine 3");
?>

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\misc\mail.php on line 2

i can't get email from locahost SMTP to my account at mail.mydomain.com

php.ini configuration:
SMTP = localhost
sendmail_from = me@localhost.com

SMTP service is running on Windows 2003 IIS; connected to dial-up; windows logon is Administrator/two

anyone there2quickly troubleshoot? please help

we are using php 4.3.2 on windows 2003 server.
i see 'FastCGI Enabled' message on top of phpinfo() page

server API CGI/FastCGI ( this i see in o/p of phpinfo() )
all files of php engine r in c:\php4folder 'c:\php4' also contains a folder nanmed 'php'
we've a php.ini file in C:/windows

is it not possible to send mail from localhost 2 other domain

is this information sufficient?
please answer.

anshul

11:39 am on Aug 4, 2004 (gmt 0)

10+ Year Member



With few modifications, i m getting error:

Warning: mail(): SMTP server response: 550 5.7.1 Unable to relay for xyz@somedomain.com in c:\inetpub\wwwroot\misc\mail.php on line 2

code of file:
<?php
mail("xyz@somedomain.com", "My Subject", "Line 1\nLine 2\nLine 3");
?>

Please help.

sullen

12:07 pm on Aug 4, 2004 (gmt 0)

10+ Year Member



I can't verify your PHP code, but it sounds like your SMTP is set to block mail relay. Have you checked the settings in IIS?