Jump to content

Recommended Posts

Guest dave@ukdic
Posted (edited)

Ive installed wamp on my local machine and going through the excellent tutorials.

 

Ive run into a problem with the post function. After copying the function code:

<?php 
$did_send = mail('general@ukdic.co.uk' , 'ukdic test email' , "The body message");
echo " Email sent " . $did_send;
?>

 

I got this error in the browser:

   
[b]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\php_test_files\Hello-world.php on line 49[/b]

Email sent

 

I then changed the smtp setting from 'localhost' to my real smtp mail address (mail.something.co.uk) in my php .ini file as suggested in another post sometime ago.

 

However, even though Ive made the changes, Im still getting the error message. From what I can make out, the mail function was ignored and just went on and echoed the Email sent.

 

I'd appreciate any help to get this problem fixed. As I'm really enjoying the tutorials.

Edited by dave@ukdic
Posted

This usually happens when you are trying to use the mail() function on your local machine. I usually encourage people to bypass this for now, and test on a live server, where you shouldn't run into this issue. If I can find the links about setting up your php.ini file correctly to allow you to send email from your local machine, I'll post them.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...