Which group

M

MikeR

Bob said:
I suppose it depends on the context. If you are using it in code being
processed by ASP, then this is the right location.
I know of no group set up specifically for CDONTS questions.
Incidentally, CDONTS is obsolete. See
http://classicasp.aspfaq.com/email/how-do-i-send-e-mail-with-cdo.html
Thanks, Bob.
I have an asp page which e-mails an updated Access db to a couple of people. One
of them uses Outlook, and it refuses an .mdb file, so I'm renaming the file to a
..txt extension. As you see, I've switched to CDO and the problem is the same.
Here's a little test page (sorry for the wrapping):

Set fso = CreateObject("Scripting.FileSystemObject")
fso.MoveFile Server.Mappath("\db\My_DB.mdb"), Server.Mappath("\db\My_DB.txt")
Set objMail = Server.CreateObject("CDO.Message")
ObjMail.Configuration.Fields.Item
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
ObjMail.Configuration.Fields.Item
("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="mail.yoursite.com"
ObjMail.Configuration.Fields.Item
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
ObjMail.Configuration.Fields.Item
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False
ObjMail.Configuration.Fields.Item
("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
objMail.From = "(e-mail address removed)"
objMail.To = "(e-mail address removed)"
objMail.BCC = "(e-mail address removed)"
objMail.Subject = "Yesterday's Updates Table as .txt"
objMail.TextBody = "Here it is with a .txt extension"
objMail.AddAttachment(Server.MapPath("/db/My_DB.txt"))
objMail.Send
Set objMail = nothing
fso.MoveFile Server.Mappath("\db\My_DB.txt"), Server.Mappath("\db\My_DB.mdb")

If I rename the .mdb, this appears in the e-mail body following what looks like
an HTML horizontal line. I I just send it as a .mdb, it doesn't have the "goo"
as outlined below.
Mike

YY=
t
 ‡ã¥=(00ÿÿÿÿ

If I hit the reply button additional characters are exposed:
Y=
t
 ‡ã¥=(00ÿÿÿÿ Name="qsl_updates"
HelpContextID="0"
VersionCompatible32="393222000"
CMG="4042A82EAC2EAC2EAC2EAC"
DPB="8082686B696B696B"
GC="C0C228AB29AB2954"

[Host Extender Info]
&H00000001={3832D640-CF90-11CF-8E43-00A0C911005A};VBE;&H00000000

[Workspace]
YYYYYYYÿÿÿÿÿÿÿÿÿÿ “
N

Ä  : õ ° k & á
œ
W

Í ˆ C þ¹t/ê¥=
t
 ‡ã¥=(00ÿÿÿÿ Name="qsl_updates"
HelpContextID="0"
VersionCompatible32="393222000"
CMG="4042A82EAC2EAC2EAC2EAC"
DPB="8082686B696B696B"
GC="C0C228AB29AB2954"

[Host Extender Info]
&H00000001={3832D640-CF90-11CF-8E43-00A0C911005A};VBE;&H00000000

[Workspace]
£«q2Ó7šV9é¨Ö[æaeJ}Q‡ÊÐx[lŸ³IZÓ¼cÌó¾K»µ–ƒö„zI‡ƒ´±ï¸ÝŽ9QZõO¦è¶Jú cö´YIAôÍ›v¥âÁÇjp£«q2Ó7šV9é¨Ö[æaeJ}Q‡ÊÐx[lŸ³IZÓ¼cÌó¾K»µ–ƒö„zI‡ƒ´±ï¸ÝŽ9QZõO¦è¶Jú cö´YIAôÍ›v¥âÁÇjp£«q2Ó7šV9é¨Ö[æaeJ}Q‡ÊÐx[lŸ³IZÓ¼cÌó¾K»µ–ƒö„zI‡ƒ´±ï¸ÝŽ9QZõO¦è¶Jú cö´YIAôÍ›v¥âÁÇjp£«q2Ó7šV9é¨Ö[æaeJ}Q‡ÊÐx[lŸ³IZÓ¼cÌó¾K»µ–ƒö„zI‡ƒ´±ï¸ÝŽ9QZõO¦è¶Jú cö´YIAôÍ›v¥âÁÇjp£«q2Ó7šV9é¨Ö[æaeJ}Q‡ÊÐx[lŸ³IZÓ¼cÌó¾K»µ–ƒö„zI‡ƒ´±ï¸ÝŽ9QZõO¦è¶Jú cö´YIAôÍ›v¥âÁÇjp£«q2Ó7šV9é¨Ö[æaeJ}Q‡ÊÐx[lŸ³IZÓ¼cÌó¾K»µ–ƒöL#ÿÿÿÿÿÿÿÿÿÿÿ Z
ý ´ g  Í ‚ ß
~
)
È o  €
m
Z
G
Ð ½ ª —ÿ=
t
 ‡ã¥=(00ÿÿÿÿÿÿÿÿÿÿ Name="qsl_updates"
HelpContextID="0"
VersionCompatible32="393222000"
CMG="4042A82EAC2EAC2EAC2EAC"
DPB="8082686B696B696B"
GC="C0C228AB29AB2954"

[Host Extender Info]
&H00000001={3832D640-CF90-11CF-8E43-00A0C911005A};VBE;&H00000000

[Workspace]
YYYYˆ
\
é º k YYYYÝ
Ê
·
@
-

£ } j ó à Í º C 0 
÷

m
Z
G
Ð ½ ª —
–ƒ •‚ øn÷äÑZG4½ª— 
YYLòì“„pÓ¦£Ï«=¹~þÏÕÓðpLòì“„pÓ¦£Ï«=¹~þÏÕÓðpLòì“„pÓ¦£Ï«=¹~þÏÕÓðpLòì“„pÓ¦£Ï«=¹~þÏÕÓðpUª-4°•}ȃ
Lòì“„pÓ¦£Ï«=¹~þÏÕÓðpLòì“„pÓ¦£Ï«=¹~þÏÕÓðpUª-4°•}ȃ
Lòì“„pÓ¦£Ï«=¹~þÏÕÓðpLòì“„pÓ¦£Ï«=¹~þÏÕÓðpUª-4°•}ȃ
Lòì“„pÓ¦£Ï«=¹~þÏÕÓðpLòì“„pÓ¦£Ï«=¹~þÏÕÓðpLòì“„pÓ¦£Ï«=¹~þÏÕÓðpLòì“„pÓ¦£Ï«=¹~þÏÕÓðpLòì“„pÓ¦£Ï«=¹~þÏÕÓðpLòì“„pÓ¦£Ï«=¹~þÏÕÓðpLòì“„pÓ¦£Ï«=¹~þÏÕÓðpLòì“„pÓ¦£Ï«=¹~þÏÕÓðpLòì“„pÓ¦£Ï«=¹~þÏÕÓðpLòì“„pÓ¦£Ï«=¹~þÏÕÓðpUª-4°•}ȃ
Lòì“„pÓ¦£Ï«=¹~þÏÕÓðpR zð
Ý
Ê
·
@
-

£ } j ó à Í º C 0 
÷

m
Z
G
Y
 
B

Bob Barrows [MVP]

MikeR said:
Thanks, Bob.
I have an asp page which e-mails an updated Access db to a couple of
people. One
of them uses Outlook, and it refuses an .mdb file, so I'm renaming
the file to a .txt extension.

Have you considered zipping the file instead?
 
D

Daniel Crichton

MikeR wrote on Mon, 15 Jan 2007 15:13:25 -0500:
Thanks, Bob.
I have an asp page which e-mails an updated Access db to a couple of
people. One of them uses Outlook, and it refuses an .mdb file, so I'm
renaming the file to a .txt extension. As you see, I've switched to CDO
and the problem is the same. Here's a little test page (sorry for the
wrapping):

Have you checked the raw message to see how the attachment is being added?
Outlook will assume that the .txt extension means it's text (and also look
at the MIME headers which likely say it's a text attachment which CDO adds
because the extension is .txt) and so displays it as inline text after a
line in the message body. As Bob has suggested, ZIP the file and send that
as an attachment instead, or get the user to adjust their Outlook settings
to allow mdb files (it should be a simple registry change)

Dan
 
M

MikeR

Bob said:
Have you considered zipping the file instead?
No I haven't, but I'll check with my hosting company to see if the have a
zip tool.
I use Thunderbird as a mail client, so maybe the problem is there. The effect
doesn't happen in outlook.
Thanks, Mike
 
M

MikeR

Hi Dan -
Thanks for your response.
Daniel said:
Have you checked the raw message to see how the attachment is being added? I don't know how to do that.
Outlook will assume that the .txt extension means it's text (and also look
at the MIME headers which likely say it's a text attachment which CDO adds
because the extension is .txt) and so displays it as inline text after a
line in the message body. As Bob has suggested, ZIP the file and send that
as an attachment instead, or get the user to adjust their Outlook settings
to allow mdb files (it should be a simple registry change)
It's not a problem with my Outlook user I just found out today. I use Thunderbird.
I did another test run just befor reading the newsgroup, and the body of the
e-mail contains

The original MIME headers for this attachment are:
Content-Type: text/plain;
name="MyDB.txt"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="MyDB.txt"
instead of the original squigglygoop. Does this tell you anything?
As it's only occuring on my machine, I can live with it, but curiosity compels
me to keep trying to find a reason.
Mike
 
D

Daniel Crichton

MikeR wrote on Tue, 16 Jan 2007 18:26:30 -0500:
Hi Dan -
Thanks for your response.

It's not a problem with my Outlook user I just found out today. I use
Thunderbird. I did another test run just befor reading the newsgroup, and
the body of the e-mail contains

The original MIME headers for this attachment are:
Content-Type: text/plain;
name="MyDB.txt"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="MyDB.txt"
instead of the original squigglygoop. Does this tell you anything?
As it's only occuring on my machine, I can live with it, but curiosity
compels me to keep trying to find a reason.
Mike

CDO uses the extension to determine the MIME mapping. By changing the
extension to .txt CDO has no choice but to add the text/plain content type,
because it has no idea that the content of the file is not text. If you gave
it a different extension that was unknown, or a binary data type, it might
help (say .xxx) as that should result in something like
application/octet-stream. Zipping is probably the best option - it
compresses the data (although an MDB doesn't tend to compress well unless it
hasn't been compacted for a while) and will be handled correctly when it's
received without the recipient having to mess around renaming files.

Dan
 
M

Mike Brind

<snip>

Zipping is probably the best option - it
compresses the data (although an MDB doesn't tend to compress well unless
it hasn't been compacted for a while)

Huh? A recently compacted mdb will generally compress to around 25 - 30% of
it's original size. I just tried a few using nothing more than the Windows
XP compression utility. Common file types that don't compress well are
usually those that already use some kind of compression, such as jpg, gif,
pdf.
 
D

Daniel Crichton

Mike wrote on Wed, 17 Jan 2007 10:46:14 -0000:
<snip>

Zipping is probably the best option - it

Huh? A recently compacted mdb will generally compress to around 25 - 30%
of it's original size. I just tried a few using nothing more than the
Windows XP compression utility. Common file types that don't compress well
are usually those that already use some kind of compression, such as jpg,
gif, pdf.


In my last tests compressing Access 2002 MDB files that had just been
compacted I found in many cases a less than 5% file size reduction using
WinZip 8. However, I will admit that I don't have many MDB files here - most
of our databases are in SQL Server, I use Access purely for prototyping
small databases prior to moving everything to SQL Server.

Dan
 
M

MikeR

Daniel said:
CDO uses the extension to determine the MIME mapping. By changing the
extension to .txt CDO has no choice but to add the text/plain content type,
because it has no idea that the content of the file is not text. If you gave
it a different extension that was unknown, or a binary data type, it might
help (say .xxx) as that should result in something like
application/octet-stream. Zipping is probably the best option - it
compresses the data (although an MDB doesn't tend to compress well unless it
hasn't been compacted for a while) and will be handled correctly when it's
received without the recipient having to mess around renaming files.

Dan
Dan - Thanks for the explanation. I'll play with it.
Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top