Jump to content


Photo

How to get SMTP working on PHP 5 in windows xp


  • Please log in to reply
1 reply to this topic

#1 yehuda54

yehuda54
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 06 July 2006 - 10:14 PM

I installed PHP 5 on my windows xp successuly.  However, when I try to send out mail with the mail(), I recieve the following 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()



My mail settings in my php.ini file is configured like this:

[mail function]
; For Win32 only.
SMTP = localhost     

; for Win32 only
smtp_port = 25     

; For Win32 only.
sendmail_from = me@localhost.com



Someone advise me to test if I can connect to telnet localhost 25  --  the connection failed. I am not sure what that indicates.

I tried to shut off the windows firewall and then try to use the mail(), but it still did not work.

If someone can please tell me how to get SMTP working?

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 07 July 2006 - 08:59 AM

You need to use an SMTP server in order for emails to be sent, Windows doesnt have an SMTP server installed so you cant send emails. I use my ISPs SMTP server for testing my scripts when using the mail function. See if you can use your ISPs SMTP server.
In order to setup PHP to use an SMTP server you to change SMTP = localhost to SMTP = SMTPAddress
The SMTPAddress is usually something like this  smtp.hostname.com

NOTE: You cant use SMTP servers that require authentication in order emails to be sent.

If you dont know any SMTP servers then there is a free SMTP Server software out there but I dont knwo the name of it.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users