Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 DTS , NCHAR and Codepage=65001

Author  Topic 

SamC
White Water Yakist

3467 Posts

Posted - 2003-07-26 : 12:03:02
My VB DTS loop that sends email...

With objRS
dim objMail

Do Until .EOF ' Loop through the emails

Set objMail = CreateObject("CDONTS.NewMail")

objMail.MailFormat = 0
objMail.SetLocaleIDs(65001) ' Allow Unicode

objMail.From = .Fields("EmailFrom").Value
objMail.To = .Fields("EmailTo").Value
objMail.Cc = .Fields("EmailCc").Value
objMail.Bcc =. Fields("EmailBcc").Value
objMail.Subject = .Fields("EmailSubject").Value
objMail.Body = .Fields("EmailBody").Value
objMail.Send
Set objMail = Nothing

objRS.movenext
loop
End With


Has a problem. The email sent do not always perform the newline properly, and I suspect it may be that the codepage=65001 needs to be set. I don't know how to declare codepage in a DTS VB script.

I've tried inserting the newline in various ways into the body text..

CHAR(10) + CHAR(13)

NCHAR(10) + NCHAR(13)

For reason's I don't understand, either works fine when the body text includes Japanese, but not English. Both bodytext are taken from the same column of the same table in the SQL database.

Go figure. Any suggestions appreciated.

Sam

It would be great if there were a way to open the email and dump it out in hex format (Outlook) to confirm the suspect encoding. Anyone know a technique to do this?

X002548
Not Just a Number

15586 Posts

Posted - 2003-07-28 : 10:24:45
Having a rough month Sam?

Is it possible any "unprintable" chars have to be removed...like low values?

I've seen them screw things up before...



Brett

8-)
Go to Top of Page

SamC
White Water Yakist

3467 Posts

Posted - 2003-07-28 : 16:17:20
I'm still chewing on this one, and yes, it's been a rough month. Lots of new features and some unneeded problems.

Arg !

Maybe I'm ready to be a pointy haired manager?

Sam
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2003-08-01 : 11:34:53
New month Sam...Get ready...



Brett

8-)

SELECT POST=NewId()
Go to Top of Page
   

- Advertisement -