[thelist] CFMAIL and non HTML email clients

Rudy_Limeback at maritimelife.ca Rudy_Limeback at maritimelife.ca
Wed Oct 25 14:58:56 CDT 2000

>  Is it possible to use CFMAIL to send either an HTML formatted 
> email or a plain text formatted email 

hi mike

if your question had ended there, the answer would be yes   ;o)

> ...depending on the email client's support of one or the other?

no, the only thing you can detect automatically is their browser, there is 
no way that you can detect what their email client software is

> We'd like to send out HTML formatted newsletters, but degrade to 
> plain text for those who cannot support HTML. 
> We'd like to do it on the fly, rather than have the user 
> initially select one format over another.

without trying to guess why you would want to do this, let me just point 
out that many people will resent it

html-versus-text-emails is an emotional issue, and people have strong 
preferences and aversions

if you do decide to pull the preference out of a database, note that 
CFMAIL has a QUERY attribute that allows you to send an email for each row 
of the result set from the query

i haven't used the TYPE=HTML option myself, but the way i understand the 
syntax, you will need two CFMAIL tags, one with TYPE=HTML and one without

also, for efficiency of accessing the database, you really only want one 

therefore the structure you will want (again, haven't tested this myself) 

     <CFQUERY name=foo> 
         select emailid, preference
           from yourtable

        <CFIF foo.preference="html">
            <!--- html message here --->

     <CFMAIL QUERY=foo RECIPIENT=foo.emailid>
        <CFIF foo.preference="text">
            <!--- text message here --->

holler if this doesn't make sense


More information about the thelist mailing list