Jump to content

php mailing help


aslanandbeez

Recommended Posts

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

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.