2

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

2
  • mailserver at "localhost" port 25 - Is there an smtp server supposed to be running on your machine? Commented Sep 3, 2010 at 5:43
  • no. i dont have any smtp server Commented Sep 3, 2010 at 6:05

3 Answers 3

2

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 );
Sign up to request clarification or add additional context in comments.

4 Comments

Notice: Use of undefined constant sendmail_from - assumed 'sendmail_from' in C:\wamp\www\sample\cms\download.php on line 101 Notice: Use of undefined constant SMTP - assumed 'SMTP' in C:\wamp\www\sample\cms\download.php on line 102 Notice: Use of undefined constant smtp_port - assumed 'smtp_port' in C:\wamp\www\sample\cms\download.php on line 103 Warning: 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
Those settings work with XAMPP using mail.php and pear. I understand wamp has no mail function??
You said .i got the error my ip is blacklisted - use your usual email sender as the SMTP
@rhys How do you find out your send? I am on windows but want to send from my linux server that has no problem sending mail...
1

I have used Fake Sendmail to successfully send emails from my localhost running WAMP.

Try following the instructions here to get it up and running.

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.