Hi Can anyone tell me how to have the email that is received from a form on a website formatted so it looks nicer.


Here is the code that generates what i see in the received email. i just want to make some lines bold and in red and on moved down a line. especially the line that reads " Type of cakes required are"

i'll be grateful for any pointers

$message="name: = ".$name."
My email address is: = ".$email."
My contact number: ".$contactnumber."
Number of guests: = ".$Numberofguests."
Date cakes required are
day : = ".$day."
month: = ".$month."
year: = ".$year."
Type of cakes required are
Cupcakes: = ".$Cupcakes."
Mini cupcakes: = ".$Minicupcakes."
Mixed cupcakes: = = ".$Mixedcupcakes."
Occasion cakes: = ".$Occasioncakes."
Cupcake tower: = ".$Cupcaketower."
Is a cupcake tower required?
Yes to topcake: = ".$Yestotopcake."
No topcake: = ".$Notopcake."
Not sure: = ".$Notsure."
Collection or delivery
I will collect: = ".$Iwillcollect."
Quote delivery: = ".$Quotedelivery."
Quote Delivery and setup: = ".$QuoteDeliveryandsetup."
Not sure yet: = ".$Notsureyet."
Delivery post code area: = ".$Deliverypostcodearea."
Wedding style: = ".$Weddingstyle."
Enquiry: = ".$Enquiry."
";

If you need bold and colors, then you have to use HTML e-mail. There's an example on the mail() page, look at #example 4: http://php.net/manual/en/function.mail.php

There are some tips to apply CSS and make them work on mail clients, like inline CSS instead of using external or style element. Search on google for html email css.

bye!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.