Jump to content

How to get SMTP working on PHP 5 in windows xp


Recommended Posts

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:

[quote]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()[/quote]

My mail settings in my php.ini file is configured like this:
[quote][mail function]
; For Win32 only.
SMTP = localhost     

; for Win32 only
smtp_port = 25     

; For Win32 only.
sendmail_from = me@localhost.com[/quote]

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?
Link to comment
Share on other sites

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 [b]SMTP = localhost[/b] to [b]SMTP = SMTPAddress[/b]
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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.