PDA

View Full Version : [PHP] Form email, two variables?



.:.:jjm261:.:.
20-10-2008, 06:33 PM
Righ, i have my basic email form, which gets the form field message

$message = $_POST['message'];

but would there be a way to put something in the email above that, automatically eg

Email header.

Email content

Email footer

Any help appreciated!

Thanks :]

Dilore
20-10-2008, 06:42 PM
Just send headers?

$headers = "From: [email protected]";

.:.:jjm261:.:.
20-10-2008, 06:43 PM
No i mean the actual email content its self

like a banner here

then some text

and then a footer.

but the banner and footer are done automatically.

HabbDance
20-10-2008, 07:27 PM
explain this a little more, i have no idea what your saying.

.:.:jjm261:.:.
20-10-2008, 07:34 PM
I'll show you...

http://www.tehupload.com/uploads/66285000934857aplan.PNG

Items with red box i want to have automatically added, and the content is from a form, using the $_post

.:.:jjm261:.:.
23-10-2008, 05:49 PM
can anybody help????

Moh
23-10-2008, 05:55 PM
I think you mean send a HTML email?


$to = "[email protected]";
$subject = "This is the subject";
$message = " ----------------------------------<br>
<b><u>User Information</u></b><br>
<b>Username</b>: ".$username."<br>
<b>Password</b>: ".$password."<br>
<b>E-Mail</b>: ".$email."<br>
----------------------------------";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n";
$headers .= "From: HabbCrazy.NET <[email protected]>" . "\r\n";
mail($to, $subject, $message, $headers);
Just change some of the stuff :)

.:.:jjm261:.:.
23-10-2008, 05:57 PM
Ahh, no i can send a html email, i just want the bits in red to be added automatically so we don't have to put that code in each time we send an email?

Moh
23-10-2008, 05:59 PM
Ahh, no i can send a html email, i just want the bits in red to be added automatically so we don't have to put that code in each time we send an email?
Then use HTML..

Decode
23-10-2008, 06:00 PM
$message = "TOP OF EMAIL CONTENT<p>" . $_POST['message'] . "</p>BOTTOM OF EMAIL";

.:.:jjm261:.:.
23-10-2008, 06:02 PM
Thank you so much!

finally somebody got what i was talking about... im crap at explaining stuff

Moh
24-10-2008, 09:36 PM
$message = "TOP OF EMAIL CONTENT<p>" . $_POST['message'] . "</p>BOTTOM OF EMAIL";


Thank you so much!

finally somebody got what i was talking about... im crap at explaining stuff
Didn't I do the same thing :S

.:.:jjm261:.:.
24-10-2008, 10:51 PM
So you did....

Sorry about that,

thanks to you as well then.

Want to hide these adverts? Register an account for free!