Jump to content

Mail function from Web Page gives error


learner1901

Recommended Posts

Hi Experts,

When I try to send email from my web page (using PHP) I get the following error in my code.

I am using Dreamweaver CS3.

 

My php code :

 

<?php

$name = $_POST['name'];

$address = $_POST['address'];

$email = $_POST['email'];

$message = $_POST['message'];

 

$message1 = " Somaone has contacted through the website . \n

Name : $name \n

Address : $address \n

Email : $email \n

Message : $massage \n " ;

$from = " From : $email ";

mail('mail1@yahoo.com','Contact from our website', $message1, $from);

?>

 

Error : Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:"  header missing in C:\xampp\htdocs\sendmail.php on line 17

[ line 17 -> mail('mail1@yahoo.com','Contact from our website', $message1, $from); ]

 

Thanks in advance for all your suggestions.

 

Link to comment
https://forums.phpfreaks.com/topic/222326-mail-function-from-web-page-gives-error/
Share on other sites

I agree there might be a configuration issue, but wondering what to check. I am using Dreamweaver and XMPP for local host. I can access php.ini file. Do I need to make any changes here?

 

Also I have not yet set ODBC connection - can this be the reason?

 

Please suggest !!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.