tags:

views:

43

answers:

2

Hi all, when i tried sending a mail using php mail function at localhost, i get the following error....what could be the issue....i even tried changing php.ini file and gave smtp host value my service provider value and it still dint work

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

A: 

Well do you have a mailserver configured on localhost? Otherwise to use mail you will probably have to use you internets provider smtp servers instead of localhost to connect.

Iznogood
no way out....i got the error my ip is blacklisted
Sanjai Palliyil
A: 

For me, adding the following code in the calling file did the trick

// xampp code fix      
ini_set( sendmail_from, "[email protected]" ); \\ My usual e-mail address
ini_set( SMTP, "mail.bigpond.com" );  \\ My usual sender
ini_set( smtp_port, 25 );
Rhys
Notice: Use of undefined constant sendmail_from - assumed 'sendmail_from' in C:\wamp\www\sample\cms\download.php on line 101Notice: Use of undefined constant SMTP - assumed 'SMTP' in C:\wamp\www\sample\cms\download.php on line 102Notice: Use of undefined constant smtp_port - assumed 'smtp_port' in C:\wamp\www\sample\cms\download.php on line 103Warning: mail() [function.mail]: SMTP server response: 550 Message rejected because (ITF152) [122.172.120.168] is blacklisted. in C:\wamp\www\sample\cms\download.php on line 109
Sanjai Palliyil
i got the above error when i tried the above method
Sanjai Palliyil
Those settings work with XAMPP using mail.php and pear. I understand wamp has no mail function??
Rhys
You said .i got the error my ip is blacklisted - use your usual email sender as the SMTP
Rhys