Formatting Emails

the mail() function

Moderators: egami, macek, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 26
Joined: Fri Jun 27, 2003 11:51 am
Location: Bath UK

Tue Dec 09, 2003 9:49 am


I have the following code to send an email:

Code: Select all

$pid = $row['pid'];
$password = $row['password'];
$name = $row['name'];
$message = "
Hi," .$name. "<br>
You or someone using you FCA Pilot ID has requested your password your deatils are as follows:
Pilot ID:" .$pid. "
Password:"   .$password. "
FCA Virtual Staff
This is an automatically generated message, please dont reply to this email";
$from = "";
$to = $row['email'];
$subject = "Your Details";

I want to change the color and font etc of the text and also add a picture before the message,
if i add normal HTML then this shows in the email and i dont want it to, i really havent got a clue how to do it, any help would be great!
Dan - New Commity Comming soon!

User avatar
Posts: 2257
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back

Tue Dec 09, 2003 10:31 am

You have to send it as HTML mail, which is formatted differently than regular e-mail. There are plenty of tutorials to be Googled, but Zend has one that looks good.

Martin Pickering
New php-forum User
New php-forum User
Posts: 106
Joined: Fri Oct 17, 2003 8:00 am

Mon Apr 19, 2004 2:31 pm

I don't mean to be rude but you might like to correct the spelling and punctuation before worrying about the color of the text! :)

Also bear in mind that many people trash HTML messages unread in order to minimize spam and viruses. I do and I'm certainly not alone.

Martin Pickering (UK)

Post Reply