PRB: CDONTS Line Length is Limited to 74 CharactersID: Q201352
|
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.
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.
This behavior is by design.
The following code samples show how to set the appropriate properties using two different objects.
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
Set myMail = CreateObject("CDONTS.NewMail")
'Remarking out the following 2 lines will cause plain text to be sent.
myMail.BodyFormat=0
myMail.MailFormat=1
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
Additional query words: kbMsg kbCDONTS
Keywords : kbMsg kbCDONTS kbGrpMsg
Version : WINDOWS:1.2
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: April 8, 1999