help needed configuring external mailserver

I was trying to test the contact form and got the following error

14:36:42.101721 error php

mail() [<a href=‘function.mail’>function.mail</a>]: Failed to connect to

mailserver at &quot;localhost&quot; port 25, verify your &quot;SMTP&quot;

and &quot;smtp_port&quot; setting in php.ini or use ini_set()

(C:\wamp\www\yiiroot2\testdrive\protected\controllers\SiteController.php:61)

Stack trace:

#0 C:\wamp\www\yiiroot2\framework\web\CController.php(309):

CInlineAction->runWithParams()

#1 C:\wamp\www\yiiroot2\framework\web\CController.php(287):

SiteController->runAction()

#2 C:\wamp\www\yiiroot2\framework\web\CController.php(266):

SiteController->runActionWithFilters()

#3 C:\wamp\www\yiiroot2\framework\web\CWebApplication.php(276):

SiteController->run()

#4 C:\wamp\www\yiiroot2\framework\web\CWebApplication.php(135):

CWebApplication->runController()

#5 C:\wamp\www\yiiroot2\framework\base\CApplication.php(162):

CWebApplication->processRequest()

#6 C:\wamp\www\yiiroot2\testdrive\index.php(13): CWebApplication->run()

REQUEST_URI=/Yiiroot2/testdrive/index.php/site/contact

in C:\wamp\www\yiiroot2\testdrive\protected\controllers\SiteController.php

(61)

in C:\wamp\www\yiiroot2\testdrive\index.php (13)

so looking at an answer in google … the suggestion was to set

[mail function]

; For Win32 only.

; http://php.net/smtp

SMTP = mail.geosz.com

; http://php.net/smtp-port

smtp_port = 25

where my smtp is my remote smtp mail server

i also set a parameter for sendmail_from = george@geosz.com

so i am puzzled why i get the error

anyone help me??

george

did you resolve this issue ?

normally this will be caused under two possible scenarios:

a) when you are trying to use a mail function from your own machine or from your local server, in both cases.

OR, maybe,

B) your are trying to connect to a real mail server, but protected by a firewall or, in worst case, your IP address is marked in a black list (or maybe the IP address of your router or super router is marked in a blacklist).

No I never resolved it, but as you pointed out I was testing locally so decided to wait until I deployed onto my remote servers before I tested.

I got sidetracked with other client work so haven’t returned yet to my research project…

Simple solution: dont test your php mail function calls in your local machine, so, let this code runs only on your real server.