Jump to content

send mail error


fazlionline

Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...