I have found that if an attachment whose size is n*45+14
is attached using NewMail, the attachment is corrupted,
and can not be read by the recipient. If the attachment
is an RTF file, Word 2003 refuses to open it at all,
giving a pop-up saying "Word experienced an error trying
to open the file." Wordpad opens the file, with a bit of
garble at the end.
We have worked round the problem by checking the file
size when it is generated, and if appropriate adding CR
LF to the end (outside the RTF terminator).
The problem seems to have been introduced when Service
Pack 3 for Windows 2000 Server was installed in June 2003.

The problem can be reproduced with the following .vbs
script, run with cscript:

Set objSendMail = CreateObject("CDONTS.NewMail")
objSendMail.To = "recip@Company.com"
objSendMail.From = "from@Company.com"
objSendMail.Subject = "Test with attachment"
objSendMail.Body = "Just testing - JRL"
objSendMail.AttachFile "C:\attch.txt"
objSendMail.Send
Set objSendMail = Nothing

If the file attch.txt is exactly 59 bytes long (or any
other size that is n*45+14), the attachment to the email
will be 69 bytes long, with the last few bytes corrupt.

The cause is that the attachment is sent uuencoded, and
if the number of bytes to be encoded into the last data
line of the uuencoded stream is 14, the first character
on the line is ">" when it ought to be "." . On my (UK)
keybourd these are on the same key - I wonder if there is
a lookup table with a wrong value in it?

Re: CDONTS - Newmail corrupt attachment by Egbert

Egbert
Fri Jan 30 11:16:15 CST 2004

"JRL" <anonymous@discussions.microsoft.com> wrote in message
news:735d01c3e733$1d447580$a501280a@phx.gbl...
> I have found that if an attachment whose size is n*45+14
> is attached using NewMail, the attachment is corrupted,
> and can not be read by the recipient. If the attachment
> is an RTF file, Word 2003 refuses to open it at all,
> giving a pop-up saying "Word experienced an error trying
> to open the file." Wordpad opens the file, with a bit of
> garble at the end.
> We have worked round the problem by checking the file
> size when it is generated, and if appropriate adding CR
> LF to the end (outside the RTF terminator).
> The problem seems to have been introduced when Service
> Pack 3 for Windows 2000 Server was installed in June 2003.
>
> The problem can be reproduced with the following .vbs
> script, run with cscript:

Try CDO... CDONTS is obsolete...
If you have found a bug in CDONTS, MS *will* not fix it :<




<%
Dim cdoConfig, mail
Set mail = CreateObject("CDO.Message")
Set cdoConfig = CreateObject("CDO.Configuration")
with cdoConfig.fields
.item("http://schemas.microsoft.com/cdo/configuration/sendusing").value =
2

.item("http://schemas.microsoft.com/cdo/configuration/smtpserver").value =
"192.168.0.7" '<-- here comes your SMPT server
.update
End With

Set mail.Configuration = cdoConfig
Mail.To = "anyone@blah.com"
Mail.From = "youremail@blah.com"
mail.Subject ="my SUbject"
mail.Textbody= "la la la "
mail.AddAttachment "c:\myfiles\file.doc"

Mail.Send

And if the UUENCODe problem still exists, you can try to encode base64
because that is supported as well.

%>


> The cause is that the attachment is sent uuencoded, and
> if the number of bytes to be encoded into the last data
> line of the uuencoded stream is 14, the first character
> on the line is ">" when it ought to be "." . On my (UK)
> keybourd these are on the same key - I wonder if there is
> a lookup table with a wrong value in it?


Re: CDONTS - Newmail corrupt attachment by Paul

Paul
Fri Jan 30 11:29:14 CST 2004

On Fri, 30 Jan 2004 05:15:21 -0800, "JRL"
<anonymous@discussions.microsoft.com> wrote:

>I have found that if an attachment whose size is n*45+14
>is attached using NewMail, the attachment is corrupted,
>and can not be read by the recipient. If the attachment
>is an RTF file, Word 2003 refuses to open it at all,
>giving a pop-up saying "Word experienced an error trying
>to open the file." Wordpad opens the file, with a bit of
>garble at the end.
>We have worked round the problem by checking the file
>size when it is generated, and if appropriate adding CR
>LF to the end (outside the RTF terminator).
>The problem seems to have been introduced when Service
>Pack 3 for Windows 2000 Server was installed in June 2003.
>
>The problem can be reproduced with the following .vbs
>script, run with cscript:
>
>Set objSendMail = CreateObject("CDONTS.NewMail")
>objSendMail.To = "recip@Company.com"
>objSendMail.From = "from@Company.com"
>objSendMail.Subject = "Test with attachment"
>objSendMail.Body = "Just testing - JRL"
>objSendMail.AttachFile "C:\attch.txt"
>objSendMail.Send
>Set objSendMail = Nothing

Read these :

HOW TO: Migrate the Collaboration Data Objects for NTS Applications to
Microsoft Collaboration Data Objects for Windows 2000
http://support.microsoft.com/?kbid=810702

How do I send e-mail with CDO?
http://www.aspfaq.com/show.asp?id=2026


Regards,

Paul Lynch
MCSE

Re: CDONTS - Newmail corrupt attachment by JRL

JRL
Fri Jan 30 12:02:26 CST 2004


>-----Original Message----- (part)
>
>Try CDO... CDONTS is obsolete...
>If you have found a bug in CDONTS, MS *will* not fix
it :<
>
But as far as I can tell cdonts.dll was updated in W2000
Service Pack 3 - and I believe that the bug was
introduced by that Service Pack (I have an email from
before the date we installed SP3 that is of the critical
size but which is not corrupt). I have cdonts.dll
version 6.0.3940.15 size 402,704.

Surely even Microsoft would support a product in which a
bug was introduced for more than 18 months from release?

Re: CDONTS - Newmail corrupt attachment by Egbert

Egbert
Fri Jan 30 12:34:14 CST 2004

"JRL" <anonymous@discussions.microsoft.com> wrote in message
news:767501c3e75b$38214310$a401280a@phx.gbl...
>
> >-----Original Message----- (part)
> >
> >Try CDO... CDONTS is obsolete...
> >If you have found a bug in CDONTS, MS *will* not fix
> it :<
> >
> But as far as I can tell cdonts.dll was updated in W2000
> Service Pack 3 - and I believe that the bug was
> introduced by that Service Pack (I have an email from
> before the date we installed SP3 that is of the critical
> size but which is not corrupt). I have cdonts.dll
> version 6.0.3940.15 size 402,704.
>
> Surely even Microsoft would support a product in which a
> bug was introduced for more than 18 months from release?

I agree with you. I know more components that are not fixed. If there are
sufficient customers having trouble with that component, it get's fixed.
It's a business model, sort of.
But really, implementing CDO instead of CDONTS is a snap ... :)
At the same time, CDO is a lot better if you talk about features.
Success


CDONTS - Newmail corrupt attachment by JRL

JRL
Mon Feb 02 04:42:34 CST 2004


Many thanks to those who have replied, with suggestions
to use CDO (good idea) and where to find advice.
I have now tried CDO - and (surprise surprise) it has the
same bug. The only difference is that with CDO the
default encoding is MIME. With CDONTS I think you get
uuencoding, whatever you specify - uuencoding certainly
seems to be the default.
I shall now start a new thread for the fault in
uuencoding in CDO.