Page 1 of 1
mail() using Windows SMTP Service
Posted: Sun Apr 23, 2006 8:36 am
by anjanesh
Im using PHP 5.1.1 + Apache 2.0.55 on Win XP Pro also having IIS 5.1 with Windows SMTP Service running.
In phpinfo(),
Internal Sendmail Support for Windows : Enabled
Code: Select all
SMTP localhost localhost
smtp_port 25 25
How do I get the mail function to work ?
I get
Code: Select all
Warning: mail() [function.mail]: SMTP server response: 501 5.5.4 Invalid Address in C:\xxx\mail.php on line 21
Thanks
Posted: Sun Apr 23, 2006 8:52 am
by timvw
The mail function does work.
It's your SMTP server that complains that you've used an invalid address...
Thus, feed it with valid addresses or configure your smtpd to accept the address...
Posted: Sun Apr 23, 2006 9:10 am
by anjanesh
My IIS is running on localhost:81
So I changed SMTP settings in php.ini
Code: Select all
[mail function]
; For Win32 only.
SMTP = localhost:81
smtp_port = 25
Now I get
Code: Select all
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost:81" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xxx\mail.php on line 21
Posted: Sun Apr 23, 2006 9:32 am
by anjanesh
Changed port from 25 to 587 - in php.ini and in Windows SMTP Service settings.
Now I get
Code: Select all
Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for recipient@domain.com in C:\xxxmail.php on line 21
EDIT : I got it working - but all the EML files are in C:\Inetpub\mailroot\Queue and no mail has been sent so far.