Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Plain text vs HTML email 1

Status
Not open for further replies.

AlaskanDad

Programmer
Mar 1, 2002
188
US
I'm trying to send out ONE newsletter email to my members in HTML format. I can do that very well. However, my plain text only members can't read it. So, I send out two emails, one in each format. Now, someone complains about getting two.

How can I send out ONE e-mail that has a lot of HTML content but make sure that ALL of my members can read it?

I've taken a glance at ASPEmail.com but am not really sure how that differs from CDONTS (currently using).

Thanks,
Rob
 
Sorta depends on what mechanism you use for initiating the email. If you can generate what amounts to two distribution lists, one for the folks that can accept HTML, another for those that cannot, then your problem is solved.

If you are sending the email via any of the many email components, and your members list is on a DB, then something along the lines:
Code:
  -- ASPMAil presumed
...
set objMail = Server.CreateObject("SMTPsvg.Mailer")
objMail.RemoteHost = "mail.smtp-server.com" objMail.FromAddress = "sendersemail@yourdomain.com"
rs = conn.execute("select name, email from tblMembers where formatPref='HTML'")
while not rs.EOF
    objMail.addRecipient rs("name"), rs("email")
    rs.MoveNext
end while
objMail.BodyText =sHTMLText
objMail.ContentType = "text/html"
objMail.SendMail

Next do the same thing only select only those member that
wish to receive plain text. Leave off the ...
Code:
objMail.ContentType = "text/html"
and send to that list. Done! You may even be able to
reuse the objMail object for your seceond send without destroying it.
 
Wouldn't sHTMLText (from your example above) still show all the HTML tags to the plain text members?

I'm currently using CDONTS but I think the concept is the same.
 
In CDONTS the format for specifying the treatment of the body text is...
Code:
objMail.BodyFormat   = 0

That should cause the appropriate header to be generated with the email so that any email client able to process body text as HTML will do so.

The default for BodyFormat is 1, which simply means treat the body as plain text.

Hope this helps.
 
Sure, that's what I mean.

If I set the BodyFormat to 1 and the original text had HTML tags throughout, wouldn't the plain text recipients see all of the tags?
 
Not certain. May reply on how smart the email client is. My guess is yes, the recipinet with email client not able to process HTML sees all (and hates it).

Is the problem now reduced to "How do I create the non-html version of the text to send?" Sorta depends on how you go about creating the body in the first place. If you can simply "browse" the HTML, then cut-and-paste into something mindess like notepad, then slap that version into a file of DB field, then I guess you'd be done.

OTOH, if you generate the HTML message body, how about "generating" two versions; one in HTML and one for brain-dead email clients.
 
You did bring me back to my original query.

I currently am creating two versions of my message: one with all of the tags and one that has no tags.

I really want to be able to have just one message that can be sent out and please everyone.

Are you at all familiar with ASPEmail.com?
 
Can't say that I am. Signing off for awhile. Going skiing and wont be back for a few day.

Sorry to say, I expect your ojective of only having to format a single email body is not going to pan out.

Good luck.
 
Here's something!

I was just told that most major ISPs will reject a lot of HTML e-mail if it is not "multipart". Evidently, this is the top of the game for sending out broadcast e-mail to many members.

Does anyone have any ideas on "multipart" e-mail?
 
You have inadverdantly answered your own question :)

Multipart means that your sending a multiple part mail, in this case one part that is plain text and one part that is html. Anyone whos mail client understands multipart (which should be most these days) will give them the portion of the email that fits their restrictions, if they allow html it will show as html, if they don't/can't, it should show text. The only problem with this is that you are in essence emailing them the same letter times 2, ie the letter will be twice as big as it will have a copy in html format and a copy in text format.

Here is a link to an ASPEmail quick reference, the major thing you should notice is the AltBody property. Once you set it (by supplying a text version of the email) it assumes your making a multipart email and that the body property has the html encoded version of the letter.

Hope this helps,
-Tarwn ________________________________________________________________________________
Want to get great answers to your Tek-Tips questions? Have a look at faq333-2924
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top