Re: HTML and Text emails

From: Date: Fri, 24 May 2002 20:37:40 +0000
Subject: Re: HTML and Text emails
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-99147@lists.php.net to get a copy of this message
On Fri, 24 May 2002, Fearless Froggie wrote: > I've noticed that a number of online marketing companies now advertise > the ability to send a combined HTML and Text email. The text email > readers then apparently display these as text, and html email readers > display these as html. > > I know how to send an html email, and a text email. But I can't figure > out how you would send a combined html and text email. > > Could anybody give me an idea of how this would work, or perhaps point > me the way to a tutorial or article? The tutorial doesn't have to be > specifically for PHP -- once I know how it works, I can adapt it to PHP > myself! Search the net for 'multipart/alternative'. In a nutshell, you declare the message itself as MIME type multipart/alternative, then enclose parts with types like text/plain, text/html, text/enriched, what have you. The MUA decides which format it prefers. Bear in mind that some fairly-common MUAs (either Lotus Notes or Groupwise springs to mind) can't decipher these messages and just show the whole thing. So make sure the text/plain part comes first. miguel

« previous php.general (#99147) next »