Solved

detecting HTML based e-mail

Posted on 2000-03-06
2
130 Views
Last Modified: 2013-12-25
I want to create an HTML based newsletter that is sent to users that subscribed to it. The problem is that if users do not have an HTML capable mail reader, then they can can not read the newsletter. Is there a way to autodetect if the client is capable of interpreting HTML and then send the appropriate version of the newsletter (HTML or text)?
0
Comment
Question by:mjara1
2 Comments
 
LVL 18

Expert Comment

by:mgfranz
ID: 2589366
Nope.  What you are asking for is essentially a way to tell if the user is going to open their email in a browser based client, a POP3 type viewer, or with a telnet session.  Sorry, the only way I can suggest is to submit both in the same message, the HTML based first, then tag on the text version.  

Most MIME-aware Internet mail applications are already able to either properly format text/enriched mail or, at the very least, are able to strip out the formatting commands and display the readable text. The same is not true for HTML or SGML.  The current RFC on HTML [RFC-1866] and Internet Drafts on SGML have many features which are not necessary for Internet mail, and are missing a few capabilities that text/enriched already has.

If you are able to come up with a solution please let me know...
0
 
LVL 8

Accepted Solution

by:
jhurst earned 100 total points
ID: 2589680
typically the way this is handled is to use a multi-part message with the html version and a plainn/text version marked as an alternate.

From: mere@here.now
Subject: your subject
Mime-Version: 1.0
Content-Type: multipart/related;
        type="multipart/alternative";
        boundary="=====================_1068495==_.REL"
Status: RO

--=====================_1068495==_.REL
Content-Type: multipart/alternative;
        boundary="=====================_1068503==_.ALT"

--=====================_1068503==_.ALT
Content-Type: text/plain; charset="us-ascii"; format=flowed

This is a special version since your mail reader
does not seem able to handle html pages

Your message here

--=====================_1068503==_.ALT
Content-Type: text/html; charset="us-ascii"
--=====================_1068503==_.ALT
Content-Type: text/html; charset="us-ascii"

<html>
html version of the message
<br>
<img src="cid:4.3.0.20000221163251.00a72290@shy.com.0" alt="Image"></html>

--=====================_1068503==_.ALT--

--=====================_1068495==_.REL
Content-Type: application/octet-stream; name="47125.$$itp"
Content-ID: <4.3.0.20000221163251.00a72290@shy.com.0>
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename="image.jpg"

An image goes here
--=====================_1068495==_.REL--

0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now