Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 10th, 2007, 04:10 PM
Authorized User
 
Join Date: Oct 2006
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default CDO email - character 1023 drops out!

Bizarre thing here - can you help?

I have an ASP page that builds a string and then sends it as an HTML email using the CDO object. All standard stuff. Here is code:

----------------------------------------

Set myMail=CreateObject("CDO.Message")
myMail.Subject="ONLINE LEARNING AND TESTING"
myMail.From="[email protected]"
myMail.To="[email protected]"

eText = <long string containing 1,640 characters>

myMail.HTMLBody = eText

with myMail
        .Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
        .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.xxx.com"
        .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
        .Configuration.Fields.Update
end with

myMail.Send

----------------------------------------

The email is sent successfully.

Now... when I do response.write(eText), the browser shows the text perfectly. But when the email arrives in my inbox, get this:

THE 1023rd CHARACTER IS MISSING!!!!!

This is disastrous, since in some cases this is one of the characters of important user login details contained within the email. In other cases, the 1023rd character is one of the HTML formatting characters, which means that the formatting of the HTML email becomes corrupted.

WHY is this happening? Is it a bug with the CDO object?

Please help to solve this for me... it is very urgent!

Thanks.

Jim
 
Old January 10th, 2007, 05:06 PM
Authorized User
 
Join Date: Oct 2006
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No idea why it happens. However, here is a temporary solution (very easy but took me ages to see it!!)

-------------------

    if Len(eText) >= 1023 then

        eText = Left(eText,1022) & "X" & Right(eText, Len(eText) - 1022)

    end if

-------------

i.e. just stick a spurious character (X) at position 1023 and let it get knocked out! I guess the same will happen at all multiples of 1023 as well.






Similar Threads
Thread Thread Starter Forum Replies Last Post
CDO email - missing characters BananaJim Classic ASP Professional 3 May 2nd, 2007 10:31 AM
CDO Email error Treefarn Classic ASP Professional 10 February 20th, 2007 02:39 PM
CDO email BananaJim Classic ASP Professional 6 January 27th, 2007 08:04 PM
Sending Email from ADP using CDO Scripts82 Access VBA 2 March 29th, 2006 10:50 AM
Email Problem - CDO SYS Error itHighway Classic ASP Basics 1 August 25th, 2005 05:14 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.