mail - localhost no connect
Posted by: universalbitmapper (---.fbx.proxad.net)
Date: April 04, 2006 10:53AM

Hi,

I'm trying to send an e-mail from a .php script and ie6 returns this
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() in C:\wamp\www\PAMWD\chap11email\sendmail.php
on line 12


I checked php.ini (line 606):


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


OTOH I didn't find "smtp_port" in php.ini


Maybe I should add :80 as port in php.ini?

Options: ReplyQuote
Re: mail - localhost no connect
Posted by: CyberSpatium (---.hsd1.or.comcast.net)
Date: April 04, 2006 01:22PM

WAMP does not come with an SMTP server, so you cannot send email using php scripts. For security reasons this is good thing, it will keep spammers from sending their email from your server so it looks like you sent the mail not them



Post Edited (04-04-06 13:24)

CyberSpatium
----------------------
WAMP Forum Admin

Web Development for Newbie's Blog - Check out my new blog. It is for web developers, and especially tailored for the web development newbie. If you are not fluent in “geek speak”, then this incredible resource is just you. And even if you are a web development pro, this is a great resource to check out some of the latest web development tips, news, tutorials, codes and more.

Options: ReplyQuote
Re: mail - localhost no connect
Posted by: universalbitmapper (---.fbx.proxad.net)
Date: April 04, 2006 04:51PM

It's OK to fight the spammers, but what if I want to build a WEB site that allows users to email to "webmaster" for instance.

Anyway I don't have Microsoft IIS on my XP distribution and I can't find it on the MSN site or www.download.com.

I wonder if there are freeware SMTP servers for windows???

Many thanks for your reply.

Options: ReplyQuote
Re: mail - localhost no connect
Posted by: CyberSpatium (---.hsd1.or.comcast.net)
Date: April 04, 2006 09:07PM

There are many free SMTP servers for Windows.

Most ISP's do not allow you to run an email server from your local computer. Many even block port 25 to block email from being sent by your SMTP server. There is good reason for this, because spammers have their spam-bots that travel all over the net looking for unsecure computers they can relay their spam email from.

I won’t even waste time telling you that you have a good chance of getting your SMTP server hit by a spam-bot and turned into a relay spam server. If you install an SMTP server and you are not an experienced high level system administrator, you will be exploited by spammers.

Your setup is exactly what spammers are looking for, an open and unsecure SMTP server they can relay and send millions of spam from, all from your local computer, so it appears that you where the one sending the spam, not them. The whole spammer business model depends on exploiting these weaknesses to their benefit.

If you think you must have SMTP server installed, make sure you DO NOT install it as a service, otherwise every time you boot your computer, the SMTP server will be on. Use it only while testing and developing your PHP scripts. When you decide to stop programming, turn the SMTP server off immediately.

Options: ReplyQuote
Re: mail - localhost no connect
Posted by: universalbitmapper (---.fbx.proxad.net)
Date: April 04, 2006 10:00PM

Hi, many thanks for your reply,

Unfortunetaly in the meantime I have installed Argos Free Smtp server, I checked in the service list, I can't find it, so it must be in the startup list, because it's on at startup.
I never managed to remove a program from that list, but I have a manual on monad so I guess it's time I download Microsoft script language and tidy up the startup.

Anyway I can't get Argos to work, no matter which user I declare, the sendail.php script supposed to send e-mails stops at the $from line.

For the time being I'll stop it each time I'll start the pc.

If you want get rid of spam, just get a gmail account ;-)

Many thanks for your reply

Options: ReplyQuote
Re: mail - localhost no connect
Posted by: CyberSpatium (---.hsd1.or.comcast.net)
Date: April 04, 2006 10:12PM

I have never used Argos before so I do not know how to set it up. You should post that question in the Argos support forum. Are you trying to send email as root@localhost or webmaster@somedomain.com? If you want to send mail using a domain name, you will have to setup correct DNS records for an address like:
mail.yourdomain.com

Since WAMP does not come with a DNS server, you need to use a free dynamic DNS service like www.everydns.net



Post Edited (04-04-06 22:13)

CyberSpatium
----------------------
WAMP Forum Admin

Web Development for Newbie's Blog - Check out my new blog. It is for web developers, and especially tailored for the web development newbie. If you are not fluent in “geek speak”, then this incredible resource is just you. And even if you are a web development pro, this is a great resource to check out some of the latest web development tips, news, tutorials, codes and more.

Options: ReplyQuote
Re: mail - localhost no connect
Posted by: yerman (217.169.121.---)
Date: June 08, 2006 10:05AM

Hi!
I've the same problem when I send email from php.
The message is:

Failed to connect to mailserver at "mail.myserver.domain" port 25, verify your "SMTP" and "smtp_port" setting in php.ini

I've this problem after having installed wamp with PHP5.
Previously I had another Apache-MySql-PHP suite, with an older version of PHP, and it worked fine. I just needed to define my public email server inside c:\windows\php.ini (that is SMTP = mail.myserver.domain).

I wouldn't like to use a SMTP server on my PC.
I simply would use the public server I usually used.

Can you help me?
Thank you


Options: ReplyQuote
Re: mail - localhost no connect
Posted by: tomfmason (---.ks.ks.cox.net)
Date: June 08, 2006 01:30PM

Like CyberSpatium said wamp does not come with a SMTP server. Also most ISPs block port 25, which is the SMTP port. Follow this link to see if it is blocked [scan.sygate.com].



Post Edited (06-08-06 13:32)

Options: ReplyQuote
Re: mail - localhost no connect
Posted by: yerman (---.pool876.interbusiness.it)
Date: June 09, 2006 06:49AM

Thank you for your suggestion.
I run the scan, port 25 is blocked with firewall active and closed with firewall open.
Anyway I didn't want to run a mailserver on my pc, I simply wanted to use a public mailserver to send email by php function.
On another PC, with a previous version of Apache-PHP suite, I also got after the scan the port 25 blocked, but the same I'm able to send email by php simply setting the SMTP parameter inside php.ini.
With the suite WAMP i can't do it.

Thank you

Options: ReplyQuote
Re: mail - localhost no connect
Posted by: CyberSpatium (67.170.181.---)
Date: June 09, 2006 10:44AM

to send out any kind of email you need an SMTP server.

Options: ReplyQuote
Re: mail - localhost no connect
Posted by: yfastud (58.186.128.---)
Date: June 09, 2006 10:54AM

Try hmailserver with ilohamail or squirellmail, as mine:
[mail.jlbn.com]
Hope this help,

Options: ReplyQuote


Sorry, only registered users may post in this forum.