Hi, im having some difficulty getting this code to email a message to a local address, any help appreciated!
<?php $first_name=$_POST['fname']; $last_name=$_POST['lname']; $gemail=$_POST['guest_email']; $comment=$_POST['comment']; // local mail address inserted here $to ="mhm5862@localhost"; $from = $first_name." ".$last_name; $subject="Feedback"; $headers = "From: " . $from . "rn"; $message = "This is the message to the administratorn"; $message .= $first_name." ".$last_name."n"; $message .= "Would like to pass on the following feedback:n"; $message .= $comment."n"; $message .= "Their email address is ".$gemail."n"; //$message .= "--$boundary--"; $mailsent = mail($to, $subject, $message, $headers); if ($mailsent) { echo "".$fname." ".$lname." wrote: | "); echo("
".$comment." |
The Administrator has received your request and is currently processing it. |