Article ID: 201352 - Last Review: March 4, 2004 - Revision: 1.1

PRB: CDONTS Line Length is Limited to 74 Characters

This article was previously published under Q201352

On This Page

Expand all | Collapse all

SYMPTOMS

When sending a plain text message using CDONTS, your line length is limited to 74 characters. If the line length is more than 74 characters, the line will be broken down into several lines. This happens when setting the text property of a CDONTS NewMail object.

RESOLUTION

You can work around this problem by setting the MailFormat and BodyFormat properties of the CDONTS object, or the MessageFormat property of the Message object to send MIME formatted mail. The default setting for these properties is to send plain text.

STATUS

This behavior is by design.

MORE INFORMATION

The following code samples show how to set the appropriate properties using two different objects.

Using the CDONTS Session Object

Set objSession = CreateObject ("CDONTS.Session") 
objSession.LogonSMTP "My Name", "someone@microsoft.com"
Set objOutbox = objSession.Outbox
Set objMessage = objOutbox.Messages.Add

'Remarking out the following line will cause plain text to be sent.
objMessage.MessageFormat = 0 

objMessage.Subject = "String Length Test"
objMessage.Text = "Insert message text here" 
Set objRecipient =  objMessage.Recipients.Add 
objRecipient.Name= "My Recipient"
objRecipient.Address = "someone@microsoft.com"
objMessage.Send
Set objMessage = Nothing
Set objOutbox = Nothing
Set objSession = Nothing
				

Using the CDONTS NewMail object

   Set myMail = CreateObject("CDONTS.NewMail")

   'Remarking out the following 2 lines causes plain text to be sent.
   myMail.BodyFormat=1
   myMail.MailFormat=0

   myMail.From="someone@microsoft.com"
   myMail.To="someone@microsoft.com"
   myMail.Subject="CDONTS String Length Test"
   myMail.Body= "Insert message text here"
   myMail.Send
   Set mymail=Nothing

				

APPLIES TO
  • Microsoft Collaboration Data Objects 1.2 for NT Server
Keywords: 
kbmsg kbprb KB201352
Retired KB ArticleRetired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
 

Article Translations