Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to connect to mailserver at "localhost" port 25

Tags:

php

email

smtp

I keep getting this error when I try to send an e-mail in PHP:

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\dressoholic\register.php on line 50 

my php.ini looks like this:

[mail function] ; For Win32 only. ; http://php.net/smtp SMTP = localhost ; http://php.net/smtp-port smtp_port = 25  ; For Win32 only. ; http://php.net/sendmail-from sendmail_from = [email protected] 

I'm using my laptop as a server.. What am I doing wrong? Thanks.

like image 457
Loolooii Avatar asked Dec 26 '10 02:12

Loolooii


1 Answers

You need to be running a mail server locally. If this is Unix, enable sendmail If this is Windows install the Simple Mail Transfer Server (not sure if the name is correct) component of IIs. E.g. for windows 2003 follow this: http://msdn.microsoft.com/en-us/library/8b83ac7t.aspx

like image 112
MK. Avatar answered Sep 21 '22 10:09

MK.