473,388 Members | 1,215 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,388 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 4346
"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 =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.