Jump to content

Recommended Posts

Posted (edited)

Hi all

I have a simple form and php script which sends user information (form form) to my email.

When I user enter his name, email and message in the form and press the send button, he get the error and no email go to my inbox

 

PHP Code:

 

<?php
$to      = myemail@yahoo.com';
$name = '$_POST[urname]';
$message = '$_POST[urmessage]';
$headers = 'From: webmaster@example.com' . "\r\n" .
   'Reply-To: webmaster@example.com' . "\r\n" .
   'X-Mailer: PHP/' . phpversion();

mail($to, $name, $message, $headers);
?>

 

Is anything wrong with the script?

Thanks

Edited by fazlionline
Posted (edited)

I get the following error:

 

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 E:\inetpub\vhosts\fazlionline.com\httpdocs\help\email_jlhaslip3.php on line 9

 

I am not using wamp, I have my files on server!

http://www.fazlionline.com/help/email_jlhaslip3.html

Edited by fazlionline

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...