Page 1 of 1

How to embed HTML using PHP when sending an Email

Posted: Tue Jun 10, 2003 11:32 am
by sree78
Hi there,

I am a newbie to PHP. I was working with coldfusion before and due to budget constraint, we have moved to PHP (Way to go)..

My question would be
------------------------
I have a form where people will fill up their details like for an example:-

FirstName
LastName
Address
Phone
Email

Once they have filled up, these option, they will then click the submit button which will then send the details to our office through email. I am wondering how can I embed HTML in my processing page and pass the variables. Like for an example, to have the details showup in a table layout.

I have been looking at a lot books including Oreilly, but got nothing much and i would really appreciate any feedback.

Thanks :?

Posted: Tue Jun 10, 2003 11:43 am
by SBukoski
Send the Content Type in the header of your e-mail when using the mail function. For example:

Code: Select all

mail($email, $subject, $bodytext, "Content-type: text/html; charset=iso-8859-1\r\n");
Then in your bodytext you just plug away as if it were a normal HTML file. Use yur <table> tags and everything else you need.