Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Professional
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old January 10th, 2007, 03:10 PM
Authorized User
 
Join Date: Oct 2006
Location: , , .
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="x@xxx.com"
myMail.To="x@xxx.com"

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
Reply With Quote
  #2 (permalink)  
Old January 10th, 2007, 04:06 PM
Authorized User
 
Join Date: Oct 2006
Location: , , .
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.

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 01:39 PM
CDO email BananaJim Classic ASP Professional 6 January 27th, 2007 07:04 PM
Sending Email from ADP using CDO Scripts82 Access VBA 2 March 29th, 2006 09:50 AM
Email Problem - CDO SYS Error itHighway Classic ASP Basics 1 August 25th, 2005 05:14 AM



All times are GMT -4. The time now is 01:00 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.