Truncated html email

M

Mike

I am creating both a text and html version of the same newsletter and
sending using CDOSYS.

Both of them incorporate a list of stories drawn from a database which are
assigned to a variable storyloop.

The text version works fine, but partway throught the html version when
viewed in Outlook 2000, it goes wrong. View source shows nothing obviously
wrong, except that partway through the storyloop, it just stops and then
goes onto the next section on the email.

Outputting storyloop to the browser gives perfect results, but if I remove
all parts of the html email and just assign storyloop to the .htmlbody, I
see that after exactly 1024 characters in the resulting email, I get ------
=_NextPart_000_0057_01C59E01.6E3F5F50--

Does anyone know why this would happen, and more importantly, what I can do
to correct it?

TIA

Mike
 
C

Curt_C [MVP]

Mike said:
I am creating both a text and html version of the same newsletter and
sending using CDOSYS.

Both of them incorporate a list of stories drawn from a database which are
assigned to a variable storyloop.

The text version works fine, but partway throught the html version when
viewed in Outlook 2000, it goes wrong. View source shows nothing obviously
wrong, except that partway through the storyloop, it just stops and then
goes onto the next section on the email.

Outputting storyloop to the browser gives perfect results, but if I remove
all parts of the html email and just assign storyloop to the .htmlbody, I
see that after exactly 1024 characters in the resulting email, I get ------
=_NextPart_000_0057_01C59E01.6E3F5F50--

Does anyone know why this would happen, and more importantly, what I can do
to correct it?

TIA

Mike

Shorter mails work fine though?
Have you tried to access it from another app then Outlook 2000? (XP,
2003, OE, etc?)
 
M

Mike

Curt_C said:
Shorter mails work fine though?
Have you tried to access it from another app then Outlook 2000? (XP,
2003, OE, etc?)


I've just tried it this morning using Outlook 2003, and it works fine.
However, the email was generated on a different machine (my one at
work), so now I'm narrowing it down to either the settings on my home
machine or the mail client. At least I know it's not the ASP (but then
I couldn't possibly see how it could be).

As to shorter emails working fine, I haven't tested that. I'll have to
do that this evening. I guess I will also have to spend some time
googling Mimetypes... and the MS KB. See if any light can be shed on
it all.

Mike
 
C

Chris Hohmann

Mike said:
I am creating both a text and html version of the same newsletter and
sending using CDOSYS.

Both of them incorporate a list of stories drawn from a database which are
assigned to a variable storyloop.

The text version works fine, but partway throught the html version when
viewed in Outlook 2000, it goes wrong. View source shows nothing
obviously
wrong, except that partway through the storyloop, it just stops and then
goes onto the next section on the email.

Outputting storyloop to the browser gives perfect results, but if I remove
all parts of the html email and just assign storyloop to the .htmlbody, I
see that after exactly 1024 characters in the resulting email, I
get ------
=_NextPart_000_0057_01C59E01.6E3F5F50--

Does anyone know why this would happen, and more importantly, what I can
do
to correct it?

TIA

Mike

I had something similar happen to me, when I setup an automated script to
send out scheduled reports. Try inserting some line breaks (vbCRLF) into the
generated html. For example, this:

<table>
<tr><td>Cell1.1</td><td>Cell1.2</td><td>Cell1.3</td></tr>
<tr><td>Cell2.1</td><td>Cell2.2</td><td>Cell2.3</td></tr>
<tr><td>Cell3.1</td><td>Cell3.2</td><td>Cell3.3</td></tr>
<tr><td>Cell4.1</td><td>Cell4.2</td><td>Cell4.3</td></tr>
</table>

Is better than this:

<table><tr><td>Cell1.1</td><td>Cell1.2</td><td>Cell1.3</td></tr><tr><td>Cell2.1</td><td>Cell2.2</td><td>Cell2.3</td></tr><tr><td>Cell3.1</td><td>Cell3.2</td><td>Cell3.3</td></tr>
<tr><td>Cell4.1</td><td>Cell4.2</td><td>Cell4.3</td></tr></table>


I suspect this is a problem with the way Outlook parses long continuous
strings, but that's just conjecture on my part.
 
A

Aaron Bertrand [SQL Server MVP]

I had something similar happen to me, when I setup an automated script to
send out scheduled reports. Try inserting some line breaks (vbCRLF) into
the generated html. For example, this:

<table>
<tr><td>Cell1.1</td><td>Cell1.2</td><td>Cell1.3</td></tr>
<tr><td>Cell2.1</td><td>Cell2.2</td><td>Cell2.3</td></tr>
<tr><td>Cell3.1</td><td>Cell3.2</td><td>Cell3.3</td></tr>
<tr><td>Cell4.1</td><td>Cell4.2</td><td>Cell4.3</td></tr>
</table>

And to help reduce length, you can leave out the optional closing tags on a
lot of elements.

<table>
<tr>
<td>Cell1.1
<td>Cell1.2
<td>Cell1.3
<tr>
<td>Cell2.1
<td>Cell2.2
<td>Cell2.3
<tr>
<td>Cell3.1
<td>Cell3.2
<td>Cell3.3
<tr>
<td>Cell4.1
<td>Cell4.2
<td>Cell4.3
</table>

Now, this might not be optimal in terms of validating against strict
doctypes or certain complex CSS attributes, but for generic HTML it should
be a substantial size saver.
 
M

Mike

I had something similar happen to me, when I setup an automated script
to send out scheduled reports. Try inserting some line breaks (vbCRLF)
into the generated html. For example, this:

<table>
<tr><td>Cell1.1</td><td>Cell1.2</td><td>Cell1.3</td></tr>
<tr><td>Cell2.1</td><td>Cell2.2</td><td>Cell2.3</td></tr>
<tr><td>Cell3.1</td><td>Cell3.2</td><td>Cell3.3</td></tr>
<tr><td>Cell4.1</td><td>Cell4.2</td><td>Cell4.3</td></tr>
</table>

Is better than this:

<table><tr><td>Cell1.1</td><td>Cell1.2</td><td>Cell1.3</td></tr><tr> <td
<
td>Cell3.2</td><td>Cell3.3</td></tr>
<tr><td>Cell4.1</td><td>Cell4.2</td><td>Cell4.3</td></tr></table>


I suspect this is a problem with the way Outlook parses long
continuous strings, but that's just conjecture on my part.

Here's the really weird thing - I sent it from my work server to 4
different email accounts, which I later accessed using Outlook 2000 at
home. It worked fine for 3 of the accounts, but broke on the one I was
originally testing with.

I have also tested it on the same 4 accounts using my testing server at
home - same result.

I have to assume that the problem is with the way that one of my email
service providers have configured their services, rather than anything
to do with the code, Outlook, or my IIS settings.

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,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top