Jump to content

Basic email php


jonkruse

Recommended Posts

My background is a graphic designer and I am making a website in Flash and the client wanted to have a form that you fill out a request for a dvd. In flash I have some variables called "firstname", "lastname", "email", "address", "zip"

 

When I click the button it sends me an email but I don't know how to format it in php so when I get the email the body looks like this:

 

Name

Address

City, State, Zip

 

email

 

here is the php I'm using

$sendTo = "kruse.jon@gmail.com";

$subject = "3dGeneralist website comment";

 

 

 

 

$headers = "From: " . $_POST["firstName"] ." ". $_POST["lastname"] . "<" . $_POST["email"] .">\r\n";

 

$headers .= "Reply-To: " . $_POST["email"] . "\r\n";

 

$headers .= "Return-path: " . $_POST["email"];

 

$message = $_POST["message"];

 

 

 

mail($sendTo, $subject, $message, $headers);

 

?>[/tt]

Link to comment
Share on other sites

$sendTo = "kruse.jon@gmail.com";

$subject = "3dGeneralist DVD REQUEST";

 

$headers = "From: " . $_POST["firstName"] ." ". $_POST["lastname"] . "<" . $_POST["email"] .">\r\n";

$headers .= "Reply-To: " . $_POST["email"] . "\r\n";

$headers .= "Return-path: " . $_POST["email"];

$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

 

 

$message = Name: <?=$_POST["name"];?>;

Address: <?=$_POST["address"];?>

City: <?=$_POST["city"];?>

State: <?=$_POST["state"];?>

Zip: <?=$_POST["zip"];?>

Country: <?=$_POST["zip"];?>

Email: <?=$_POST["email"];?>;

 

mail($sendTo, $subject, $message, $headers);

 

?>

 

 

When I put this in it says:

Address: City: State: Zip: Country: Email: ; // once the variables have been defined, they can be included // in the mail function call which will send you an email mail($sendTo, $subject, $message, $headers); ?>

 

Sorry I'm a complete newb.

Link to comment
Share on other sites

This is all messed up

 

$message = Name: <?=$_POST["name"];?>;

Address: <?=$_POST["address"];?>

City: <?=$_POST["city"];?>

State: <?=$_POST["state"];?>

Zip: <?=$_POST["zip"];?>

Country: <?=$_POST["zip"];?>

Email: <?=$_POST["email"];?>;

 

If you're already in PHP, then there is no need to use <? again.  You are using ; when you should use concatenations.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.