Send email in plain text format in vbscript

  • Thread starter Thread starter Long Nguyen
  • Start date Start date
L

Long Nguyen

Good day,

I have a vbscript code in my custom Outlook form that sends out an email,
similar to the code below. How can I code so that the email is sent in PLAIN
TEXT format (instead of whatever format - html/plain text/rich text - set in
the form user's Outlook environment).

Thanks
Long

Set NewMail = Item.Application.CreateItem(olMailItem)
NewMail.Subject = "My subject"
NewMail.Body = "My body"
NewMail.Recipients.Add(Item.To)
NewMail.Send
Set NewMail = Nothing
 
I am using Outlook 2000 SR-1.
Some form users use this version, some use Outlook XP (which I am not sure
the exact version number).
Thanks.
 
To generate a message in plain text format in Outlook 2000, you'll have to
create the message with CDO 1.21 (Collaboration Data Objects), rather than
Outlook objects. Outlook 2000 has no way to create a plain text message
programmatically. See http://www.outlookcode.com/d/cdo.htm for information
to help you get started with CDO.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Thansk Sue.

I have just got a new PC with Outlook 2002 SP2. The PC runs Windows XP.

Does Outlook 2002 SP2 allow creating message in plain text format? If so
could you point to me where to look for more information. If I do that under
2002 SP2, would that be ok for form users who are still using Outlook 2000
SR-1?

Thanks
Long
 
Yes, just set the BodyFormat to olFormatPlain after you create the message.
That, of course, will not work for OL2000 users.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Back
Top