dazzclub Posted March 26, 2008 Share Posted March 26, 2008 Hi all, i am trying to get my form to sumbit to my database and to my email, this is what i am using to send something to my email, just test to get it to work first; -------------- <?php /* Details Of Email */ $to="darrenpaulazzopardi@hotmail.com"; $subject="test"; $first_name=$_POST['first_name']; $email=$_POST['email']; $comments=$_POST['comments']; $details= "Email:$clientemail Name:$clientname Message:$message Inquiry:$inquiry "; mail($to,$subject,$details); ?> when i tried the form and then pressed submit it displayed; Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in E:\wamp\www\drinkpromo\enquiry.php on line 86 Now i can make changes to this script but how do i make changes to my phpini. I have looked at the relevant topics and noticed that my sendmail_from and sendmail_path have "no value" besides them, how can i change this?? In theory once these have been set can i then send to my email?? kind regards Dazzclub Quote Link to comment Share on other sites More sharing options...
ansarka Posted March 26, 2008 Share Posted March 26, 2008 <?php $to = "recipient@example.com"; $subject = "Hi!"; $body = "Hi,\n\nHow are you?"; $headers = "From: sender@example.com\r\n" . "X-Mailer: php"; if (mail($to, $subject, $body, $headers)) { echo("<p>Message sent!</p>"); } else { echo("<p>Message delivery failed...</p>"); } ?> Quote Link to comment Share on other sites More sharing options...
dazzclub Posted March 26, 2008 Author Share Posted March 26, 2008 Would I be able to send it to my email account when the site i am currently working on his just on my computer?? cheers Dazzclub Quote Link to comment Share on other sites More sharing options...
dazzclub Posted May 7, 2008 Author Share Posted May 7, 2008 To answer my above post, yes. When i uploaded it, it worked. I think if i need to test this locally, i will need to look further into my phpini file and also the php script i use. kind regards Dazzclub Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.