473,218 Members | 1,421 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,218 software developers and data experts.

cdonts question

I need send an email to my client by using CDONTS, which contain a utf-8
characters

then i am using following code

mailObject.value("Content-type") = "text/plain; charset=utf-8"
mailObject.value ("Content-transfer-encoding") = "8bit"

ls_body = ls_body & "<html><head>"
ls_body = ls_body & "<META HTTP-EQUIV=""Content-Type"" CONTENT=""text/html;
charset=utf-8""></head><body >"
ls_body = ls_body & "<font size=2>An Exhibitor has submitted a form to you
through our on-line manual system:</br></br>" & chr(13) & chr(13)
ls_body = ls_body & "Form : " & form_name & "(Form " & form_number & ")"&
"</br>" & chr(13) & chr(13)
ls_body = ls_body & "</body></html>"

mailObject.Body = ls_body
mailObject.send
set mailObject= nothing

but it sees no work...what's wrong??

thx~
Jul 19 '05 #1
5 4343
"Vitamin" <ha*@seeWhat.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
ok, i am sorry that about it.
I am try to send a email, that include a words which would be encoded by
using both big5 and gb2312, so, I need using utf-8 to display both big5 and gb2312 in the same email.

That's possible only, if the input can be done in unicode-2 format, the mail
would be encoded correctly then.
So,
First set the MIME-encoding to utf-8
Set the body text, and care for it that the Stream object for the body is
set to Utf-8 as well (w're talking about CDO here!).
Store the text (using a unicode-2 BSTR or string) and you're done.

Jul 19 '05 #2
does you mean using ADODB.Stream object to display the utf-8 char??
but I need display in the mail, since if I display the mail content in html
page, I can see it correctly.
Also, do you have any sample code for my reference?

thx~
"Egbert Nierop (MVP for IIS)" <eg***********@nospam.com> wrote in message
news:uA**************@tk2msftngp13.phx.gbl...
"Vitamin" <ha*@seeWhat.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
ok, i am sorry that about it.
I am try to send a email, that include a words which would be encoded by
using both big5 and gb2312, so, I need using utf-8 to display both big5 and
gb2312 in the same email.

That's possible only, if the input can be done in unicode-2 format, the

mail would be encoded correctly then.
So,
First set the MIME-encoding to utf-8
Set the body text, and care for it that the Stream object for the body is
set to Utf-8 as well (w're talking about CDO here!).
Store the text (using a unicode-2 BSTR or string) and you're done.

Jul 19 '05 #3
"Vitamin" <ha*@seeWhat.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
does you mean using ADODB.Stream object to display the utf-8 char??
but I need display in the mail, since if I display the mail content in html page, I can see it correctly. To display the mail correctly, you'll have to write the mail first right? :)

Code below is not tested for your situation but it looks like the right
direction.

cdoMsg.BodyPart.ContentMediaType=
CDO.CdoContentTypeValues.cdoMultipartMixed;

//

//cdoMsg.BodyPart.ContentTransferEncoding = null;

CDO.IBodyPart pBP = cdoMsg.BodyPart.AddBodyPart(-1);

pBP.Charset = this.mEncoding.BodyName;

pBP.ContentMediaType = CDO.CdoContentTypeValues.cdoTextPlain;

pBP.ContentTransferEncoding = CDO.CdoEncodingType.cdoBase64;

str = pBP.GetDecodedContentStream(); // ADODB.Stream object

//StreamWriter does the unicode/encoding stuff

// we must not touch for now, the original data, *just* copy

str.Charset = "unicode";

str.WriteText(this.mBody, ADODB.StreamWriteEnum.adWriteChar);

str.Flush();

str.Close();

Also, do you have any sample code for my reference?

thx~
"Egbert Nierop (MVP for IIS)" <eg***********@nospam.com> wrote in message
news:uA**************@tk2msftngp13.phx.gbl...
"Vitamin" <ha*@seeWhat.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
ok, i am sorry that about it.
I am try to send a email, that include a words which would be encoded by using both big5 and gb2312, so, I need using utf-8 to display both
big5 and
gb2312 in the same email.

That's possible only, if the input can be done in unicode-2 format, the

mail
would be encoded correctly then.
So,
First set the MIME-encoding to utf-8
Set the body text, and care for it that the Stream object for the body is set to Utf-8 as well (w're talking about CDO here!).
Store the text (using a unicode-2 BSTR or string) and you're done.



Jul 19 '05 #4
> but it sees no work...what's wrong??

Could you define "no work" a little better? Do you get an error message?
If so, what is it? Do you not get the e-mail? Does the e-mail go to the
wrong person? Does the text not appear right?

It's very difficult to offer you suggestions when all we have to go on is
"it's broke."

BTW, do you really need to declare UTF-8 just to send HTML content? And are
you sure you want to use CDONTS as opposed to CDO.Message?

See http://www.aspfaq.com/2474 and http://www.aspfaq.com/2026

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
Jul 19 '05 #5
Hi Egbert,

I am sorry that distrub you again, I would like to know which language you
used in the sample coding?
I am using ASP, but...I cannot understand the coding, any reference about
the coding?

thx~

"Egbert Nierop (MVP for IIS)" <eg***********@nospam.com> wrote in message
news:OD**************@TK2MSFTNGP12.phx.gbl...
"Vitamin" <ha*@seeWhat.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
does you mean using ADODB.Stream object to display the utf-8 char??
but I need display in the mail, since if I display the mail content in html
page, I can see it correctly.

To display the mail correctly, you'll have to write the mail first right?

:)
Code below is not tested for your situation but it looks like the right
direction.

cdoMsg.BodyPart.ContentMediaType=
CDO.CdoContentTypeValues.cdoMultipartMixed;

//

//cdoMsg.BodyPart.ContentTransferEncoding = null;

CDO.IBodyPart pBP = cdoMsg.BodyPart.AddBodyPart(-1);

pBP.Charset = this.mEncoding.BodyName;

pBP.ContentMediaType = CDO.CdoContentTypeValues.cdoTextPlain;

pBP.ContentTransferEncoding = CDO.CdoEncodingType.cdoBase64;

str = pBP.GetDecodedContentStream(); // ADODB.Stream object

//StreamWriter does the unicode/encoding stuff

// we must not touch for now, the original data, *just* copy

str.Charset = "unicode";

str.WriteText(this.mBody, ADODB.StreamWriteEnum.adWriteChar);

str.Flush();

str.Close();

Also, do you have any sample code for my reference?

thx~
"Egbert Nierop (MVP for IIS)" <eg***********@nospam.com> wrote in message
news:uA**************@tk2msftngp13.phx.gbl...
"Vitamin" <ha*@seeWhat.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
> ok, i am sorry that about it.
> I am try to send a email, that include a words which would be
encoded
by > using both big5 and gb2312, so, I need using utf-8 to display both big5 and
> gb2312 in the same email.
>
That's possible only, if the input can be done in unicode-2 format,
the mail
would be encoded correctly then.
So,
First set the MIME-encoding to utf-8
Set the body text, and care for it that the Stream object for the body

is set to Utf-8 as well (w're talking about CDO here!).
Store the text (using a unicode-2 BSTR or string) and you're done.


Jul 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ryan McLean | last post by:
Hello everyone! I have a question for ya'll. In a web-based asp application I am creating and (attempting to) attach a file. The email sends correctly, but when I try to open the attachment, it...
4
by: Steve | last post by:
objNewMail = Server.CreateObject("CDONTS.NewMail") How do I know whether the "Send" command from a CDONTS object actually was sent? Is there a status variable that can be checked? Or a log...
29
by: | last post by:
I did a working code with CDONTS on NT4 Now I am testing is on w2k and it looks like objCDONTS.Send is completely ignored. I think is it ignored because it throws no errors, neither does the...
4
by: F | last post by:
Hi Some one has posted this question on 10th August, as CDONTS is not working on windows 2003 serever. I have the same problem and I copied CDONTS.DLL from Windows 2000 Server and registered on...
4
by: CK | last post by:
Hi all, I know this question is stupid. But i need some advice for this. I am trying to develop a website, which will allow the user send to order form to the admin email. I am planning to use the...
12
by: Jeff | last post by:
I have a dedicated windows server on BlueGenesis. I'd like to send an email using ASP, but I'm getting this error message: Microsoft VBScript runtime error '800a01ad' ActiveX component...
4
by: Dr. Harvey Waxman | last post by:
I guess I should change from cdonts to cdosys. Since I am ignorant about asp I hope you forgive this basic question. There are two asp files for handling mail, the one that gets the info from a...
3
by: Hugo Lefebvre | last post by:
Is there a maximum number of emails CDONTS can handle in an asp script? I have different questions about this. Question1: example1: set objSendMail = createobject("CDONTS.NewMail") ...... ...
3
by: tamaker | last post by:
I have Road Runner cable internet access and Im working in a local development environment (writing .ASP) and have a site running on my network on a windows xp pro machine via IIS with CDONTS...
3
by: Prasad | last post by:
Hi all, I had to write a page in ASP which sends an email. I googled and was able to write the following code: <html> <body> <% Set Mail = Server.CreateObject("CDONTS.NewMail") Mail.To =...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.