Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Mail

Formatting Emails

the mail() function

Moderators: macek, egami, gesf

Formatting Emails

Postby fspilot » Tue Dec 09, 2003 9:49 am

Hi,

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. "
------------------------------
Regards
FCA Virtual Staff
This is an automatically generated message, please dont reply to this email";
$from = "From:no-reply@fcavirtual.co.uk";
$to = $row['email'];
$subject = "Your Details";
mail($to,$subject,$message,$from);
}


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!
fspilot
New php-forum User
New php-forum User
 
Posts: 26
Joined: Fri Jun 27, 2003 11:51 am
Location: Bath UK

Postby swirlee » 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.
User avatar
swirlee
Moderator
Moderator
 
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back

Postby Martin Pickering » 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)
Martin Pickering
New php-forum User
New php-forum User
 
Posts: 106
Joined: Fri Oct 17, 2003 8:00 am


Return to PHP coding => Mail

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.