Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sending HTML Emails using FOX
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00653430
Message ID:
00695644
Vues:
25
Hi Howard.

You seem to be the cdo expert (at least in comparison to me)!

< rof,l > and < lol > I am by no means an expert. I wrote the e-mail chapter for Megafox, so I had to do a lot of research into MAPI, Outlook Automation and CDO < s >.

I've written a small app that emails to about 500 people once a month using CDO. It works fine - except for those who don't accept HTML emails or those that convert everything to text. Do you know of a way to send a text version as an alternate if the recipient doesn't accept html emails? Is that even a possibility?

I'm fairly certain that it is possible. If you look up AutoGenerateTextBody in MSDN, it tells you that if you leave this property at its default (true) and leave the MimeFormatted property at its default (true) then all you have to do is set the HTMLBody property of the message and the textbody will be set automatically to the plain text equivalent of the HTMLBody property.

This is what MSDN has to say:

The following rules apply to the AutoGenerateTextBody property if it is set to True:

Setting HTMLBody causes TextBody to be set immediately.
Setting TextBody causes AutoGenerateTextBody to be set to False. Any existing HTML content is not updated.
Setting HTMLBody causes MimeFormatted to be set to True.
Setting MimeFormatted to False causes AutoGenerateTextBody to be set to False.

When using the AutoGenerateTextBody functionality, always update the HTML version of the message body. Updating the plain text version will not cause new HTML to be generated.

For messages that contain other alternate representations besides HTML and plain text, you must create or update each individually.

The default value of AutoGenerateTextBody is True (VARIANT_TRUE) on newly created messages and False (VARIANT_FALSE) on previously existing messages.

HTH.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform