learner1901 Posted December 21, 2010 Share Posted December 21, 2010 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 More sharing options...
nafetski Posted December 21, 2010 Share Posted December 21, 2010 Where is the site hosted? Right now it's sounding like a configuration issue...do you have access to change php.ini? Link to comment https://forums.phpfreaks.com/topic/222326-mail-function-from-web-page-gives-error/#findComment-1150013 Share on other sites More sharing options...
Pikachu2000 Posted December 21, 2010 Share Posted December 21, 2010 The From: header should be set to a valid address on your server. You may also need to use the option 5th parameter as shown in the manual for the mail function. Link to comment https://forums.phpfreaks.com/topic/222326-mail-function-from-web-page-gives-error/#findComment-1150031 Share on other sites More sharing options...
learner1901 Posted December 22, 2010 Author Share Posted December 22, 2010 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 !! Link to comment https://forums.phpfreaks.com/topic/222326-mail-function-from-web-page-gives-error/#findComment-1150345 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.