Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Why got garbage code when sending email through CDO.Message

Reply
 
Old 10-11-2008   #1 (permalink)
hghua


 
 

Why got garbage code when sending email through CDO.Message

Save the following code as a.vbs, run it, it shows an error message with
garbage code in Chinese windows.

I know the error reason, just wanna see normal error message.

Could you help? Thanks!
---
Dim o
Set o = CreateObject("CDO.Message")

o.From = "a@xxxxxx"
o.To = "a@xxxxxx"
o.Subject = "abc"
o.TextBody = "abc"
With o.Configuration
.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"mail.isoft-asia.com"
.Fields.Update
End With
o.Send

My System SpecsSystem Spec
Old 10-11-2008   #2 (permalink)
Pegasus \(MVP\)


 
 

Re: Why got garbage code when sending email through CDO.Message


"hghua" <hghua@xxxxxx> wrote in message
news:24F345B4-EC68-4118-8411-CC377A5F8235@xxxxxx
Quote:

> Save the following code as a.vbs, run it, it shows an error message with
> garbage code in Chinese windows.
>
> I know the error reason, just wanna see normal error message.
>
> Could you help? Thanks!
> ---
> Dim o
> Set o = CreateObject("CDO.Message")
>
> o.From = "a@xxxxxx"
> o.To = "a@xxxxxx"
> o.Subject = "abc"
> o.TextBody = "abc"
> With o.Configuration
> .Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
> .Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
> "mail.isoft-asia.com"
> .Fields.Update
> End With
> o.Send
I tried your script (after adding the two lines below) and got no error
message and no garbage. It simply worked.
..Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") =
"smtp@xxxxxx"
..Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") =
"somepassword"



My System SpecsSystem Spec
Old 10-11-2008   #3 (permalink)
Al Dunbar


 
 

Re: Why got garbage code when sending email through CDO.Message

"the transport failed to connect to the server"

/Al

"hghua" <hghua@xxxxxx> wrote in message
news:24F345B4-EC68-4118-8411-CC377A5F8235@xxxxxx
Quote:

> Save the following code as a.vbs, run it, it shows an error message with
> garbage code in Chinese windows.
>
> I know the error reason, just wanna see normal error message.
>
> Could you help? Thanks!
> ---
> Dim o
> Set o = CreateObject("CDO.Message")
>
> o.From = "a@xxxxxx"
> o.To = "a@xxxxxx"
> o.Subject = "abc"
> o.TextBody = "abc"
> With o.Configuration
> .Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
> .Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
> "mail.isoft-asia.com"
> .Fields.Update
> End With
> o.Send

My System SpecsSystem Spec
Old 10-12-2008   #4 (permalink)
Paul Randall


 
 

Re: Why got garbage code when sending email through CDO.Message


"hghua" <hghua@xxxxxx> wrote in message
news:24F345B4-EC68-4118-8411-CC377A5F8235@xxxxxx
Quote:

> Save the following code as a.vbs, run it, it shows an error message with
> garbage code in Chinese windows.
>
> I know the error reason, just wanna see normal error message.
>
> Could you help? Thanks!
> ---
> Dim o
> Set o = CreateObject("CDO.Message")
>
> o.From = "a@xxxxxx"
> o.To = "a@xxxxxx"
> o.Subject = "abc"
> o.TextBody = "abc"
> With o.Configuration
> .Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
> .Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
> "mail.isoft-asia.com"
> .Fields.Update
> End With
> o.Send
Since I don't get the 'garbage code', I can't verify your problem.

I once had a similar problem with what I called 'crazy characters' in the
message boxes produced by wordpad and mspaint on my WXP SP2 system. The
message boxes from all other applications were normal, but these two
applications produced what were to me Chinese-like characters in the text of
the message. I posted a question about it and received a reply that solved
the problem in microsoft.public.windowsxp.general.

Groups.google.com is the best way to find these old posts. Go there and
enter the following in the search box:
crazy font group:microsoft.* authoraul randall

Please let us know if this fixes your problem.

-Paul Randall


My System SpecsSystem Spec
Old 10-12-2008   #5 (permalink)
gimme_this_gimme_that


 
 

Re: Why got garbage code when sending email through CDO.Message

You need to research the Configuration object and look for a character
encoding attribute and set it to the encoding used on the Chinese
machine.
My System SpecsSystem Spec
Old 10-12-2008   #6 (permalink)
hghua


 
 

Re: Why got garbage code when sending email through CDO.Message

I tried to set CdoConfiguration.cdoLanguageCode to "en-us" and
CdoConfiguration.cdoUseMessageResponseText to "true", but no luck.

"gimme_this_gimme_that@xxxxxx" wrote:
Quote:

> You need to research the Configuration object and look for a character
> encoding attribute and set it to the encoding used on the Chinese
> machine.
>
My System SpecsSystem Spec
Old 10-12-2008   #7 (permalink)
hghua


 
 

Re: Why got garbage code when sending email through CDO.Message

I know setting sendusername and sendpassword will solve the error, but what I
wonder is how to see normal readable error message in Chinese windows.

"Pegasus (MVP)" wrote:
Quote:

>
> "hghua" <hghua@xxxxxx> wrote in message
> news:24F345B4-EC68-4118-8411-CC377A5F8235@xxxxxx
Quote:

> > Save the following code as a.vbs, run it, it shows an error message with
> > garbage code in Chinese windows.
> >
> > I know the error reason, just wanna see normal error message.
> >
> > Could you help? Thanks!
> > ---
> > Dim o
> > Set o = CreateObject("CDO.Message")
> >
> > o.From = "a@xxxxxx"
> > o.To = "a@xxxxxx"
> > o.Subject = "abc"
> > o.TextBody = "abc"
> > With o.Configuration
> > .Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
> > .Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
> > "mail.isoft-asia.com"
> > .Fields.Update
> > End With
> > o.Send
>
> I tried your script (after adding the two lines below) and got no error
> message and no garbage. It simply worked.
> ..Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") =
> "smtp@xxxxxx"
> ..Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") =
> "somepassword"
My System SpecsSystem Spec
Old 10-12-2008   #8 (permalink)
hghua


 
 

Re: Why got garbage code when sending email through CDO.Message

Thanks! But it doesn't work.

"Paul Randall" wrote:
Quote:

>
> "hghua" <hghua@xxxxxx> wrote in message
> news:24F345B4-EC68-4118-8411-CC377A5F8235@xxxxxx
Quote:

> > Save the following code as a.vbs, run it, it shows an error message with
> > garbage code in Chinese windows.
> >
> > I know the error reason, just wanna see normal error message.
> >
> > Could you help? Thanks!
> > ---
> > Dim o
> > Set o = CreateObject("CDO.Message")
> >
> > o.From = "a@xxxxxx"
> > o.To = "a@xxxxxx"
> > o.Subject = "abc"
> > o.TextBody = "abc"
> > With o.Configuration
> > .Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
> > .Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
> > "mail.isoft-asia.com"
> > .Fields.Update
> > End With
> > o.Send
>
> Since I don't get the 'garbage code', I can't verify your problem.
>
> I once had a similar problem with what I called 'crazy characters' in the
> message boxes produced by wordpad and mspaint on my WXP SP2 system. The
> message boxes from all other applications were normal, but these two
> applications produced what were to me Chinese-like characters in the text of
> the message. I posted a question about it and received a reply that solved
> the problem in microsoft.public.windowsxp.general.
>
> Groups.google.com is the best way to find these old posts. Go there and
> enter the following in the search box:
> crazy font group:microsoft.* authoraul randall
>
> Please let us know if this fixes your problem.
>
> -Paul Randall
>
>
>
My System SpecsSystem Spec
Old 10-12-2008   #9 (permalink)
hghua


 
 

RE: Why got garbage code when sending email through CDO.Message

Here is the error message snapshot: http://bscsh.3322.org/a.jpg
My System SpecsSystem Spec
Old 10-13-2008   #10 (permalink)
gimme_this_gimme_that


 
 

Re: Why got garbage code when sending email through CDO.Message

Well you could go down the road of setting the language code to zh-tw
instead of en-us.

You'll have to encode the subject and the text you're sending on your
end as well.

In VBScript there I haven't seen a simple way to do that.

In Java there is:

String t = new String("my string","UTF-8"); // UTF-8
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Sending message on email Vista mail
sending email error message Vista mail
Error message while sending email Vista mail
Windows Live Mail-No message in body of email when sending email m Live Mail
error message when sending email Vista mail


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46