faqts : Computers : Programming : Languages : PHP

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

12 of 630 people (2%) answered Yes
Recently 4 of 10 people (40%) answered Yes

Entry

Is there a way to use php to embed html in e-mails? Can you do this without php

Feb 26th, 2008 00:02
dman, Henrik Hansen, Michael Hutchinson, http://www.ttnr.org


Yes using php's mail function you can send both text and html mails. 
When you send html mails you need to set 2 more mail headers defining 
the content type and the mime version, these are:
MIME-Version: 1.0\r\n
Content-type: text/html; charset=iso-8859-1\r\n
for a full example, look at example 4 in the php manual page for mail().