aslanandbeez Posted June 7, 2008 Share Posted June 7, 2008 Okay I'm doing the whole email form thing on my site, and I want the name and email address from the form to go into the header, here's my code <?php $to = '[email protected]'; $name = $_POST['name']; $email = $_POST['email']; $subject = $_POST['subject']; $message = $_POST['message']; $headers = 'From: $name $email' . "\r\n" . 'Reply-To: $email' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); echo "Your message has been sent, thank you"; ?> Also I'm hoping to adapt this for an e-card service, so would I have to put the selected card and a message into a function called $content for instance then do something like; $message = '$content'; or am I on completely the wrong track? Link to comment https://forums.phpfreaks.com/topic/109123-php-mailing-help/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.