ClOuD_Za
asked on
ASP .. CDO.Message .. Charset (or Encoding)
Hi, Experts
I have a code which to send an e-mail out. Now I want it to send some other language than only English (ex, my local language, Thai). I tried every solution I could find in google but not work for me.
this is my code.
<%
Set CDONTS = Server.CreateObject("CDO.M essage")
CDONTS.From = "............."(some e-mail)
CDONTS.To = "...................."(my e-mail)
CDONTS.Subject = "Customer Comment Sent At "&Now
CDONTS.HtmlBody = "<font color=blue size=5><b><u>Received Customer Comment</b></u></font><br> <br>"
CDONTS.HtmlBody = CDONTS.HtmlBody & "Customer Name : <font color=red>"&Request.Form(" NAME")&"</ font><br>" &_
"Customer E-Mail : <font color=red>"&Request.Form(" EMAIL")&"< /font><br> "&_
"Customer Phone Number : <font color=red>"&Request.Form(" PHONE")&"< /font><br> "&_
"Received At : <font color=red>"&Now&"</font><b r>"&_
"Customer Comment : <font color=red>"&Request.Form(" COMMENT")& "</font><b r>"&_
"<br>--------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- -----<br>"
%>
<%
CDONTS.Send
%>
this code is working fine with sending e-mail out but the language is incorrect...
please help
I have a code which to send an e-mail out. Now I want it to send some other language than only English (ex, my local language, Thai). I tried every solution I could find in google but not work for me.
this is my code.
<%
Set CDONTS = Server.CreateObject("CDO.M
CDONTS.From = "............."(some e-mail)
CDONTS.To = "...................."(my e-mail)
CDONTS.Subject = "Customer Comment Sent At "&Now
CDONTS.HtmlBody = "<font color=blue size=5><b><u>Received Customer Comment</b></u></font><br>
CDONTS.HtmlBody = CDONTS.HtmlBody & "Customer Name : <font color=red>"&Request.Form("
"Customer E-Mail : <font color=red>"&Request.Form("
"Customer Phone Number : <font color=red>"&Request.Form("
"Received At : <font color=red>"&Now&"</font><b
"Customer Comment : <font color=red>"&Request.Form("
"<br>---------------------
%>
<%
CDONTS.Send
%>
this code is working fine with sending e-mail out but the language is incorrect...
please help
you want windows to convert it from english to thai? or you just want the corret character set?
ASKER
I think the character is incorrect at the sending time. so windows couldn't deal with this.
You mean this http://support.microsoft.com/kb/229690 ?
ASKER
i think it should be about setting e-mail's charset to TIS-620 (for Thai language).
with that microsoft kb. is that only about Date, Time and Currency ? because I don't need any of these in my e-mail body.
with that microsoft kb. is that only about Date, Time and Currency ? because I don't need any of these in my e-mail body.
ASKER
sorry for my poor english anyway :(
Try
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1054"%>
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1054"%>
ASKER
the browser said "the page cannot be display"
Error Type:
Active Server Pages, ASP 0203 (0x80004005)
The specified code page attribute is invalid.
with this line:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1054"%>
I insert that line at the first row of all.
Error Type:
Active Server Pages, ASP 0203 (0x80004005)
The specified code page attribute is invalid.
with this line:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1054"%>
I insert that line at the first row of all.
You will also need to specify it in the HTML message also you are sending
ASKER
you mean it must be inserted in the HTMLBody ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
It replace
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1054"%>
with
<%@codepage=65001%>
it shows no error but no e-mail has been sent.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1054"%>
with
<%@codepage=65001%>
it shows no error but no e-mail has been sent.
ASKER
first section of code ...
<%@codepage=65001%>
<%
Set CDONTS = Server.CreateObject("CDO.M essage")
.
.
.
.
<%@codepage=65001%>
<%
Set CDONTS = Server.CreateObject("CDO.M
.
.
.
.
I think after a little research , the ASP must be set and also the html in the message must be set, so you have to include <html> and <head>,<body> tags...
in the ASP you need to:
response.Charset="windows- 874"
or
<%@codepage=874%>
in the html you need
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
in your head tags
in the ASP you need to:
response.Charset="windows-
or
<%@codepage=874%>
in the html you need
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
in your head tags
ASKER
the ASP file is only to send out and e-mail . It has nothing to display on screen .
so still I need this line ?
response.Charset="windows- 874"
so still I need this line ?
response.Charset="windows-
I believe so cause your accepting text from a textbox? or is the text provided by you?
ASKER
it's a set of value which is passed from a form via POST method.
ASKER
Now the code is ..
<%@codepage=874%>
<%
Set CDONTS = Server.CreateObject("CDO.M essage")
CDONTS.From = "......"
CDONTS.To = ".........."
CDONTS.Subject = "Customer Comment Sent At "&Now
CDONTS.HtmlBody = "<html><head>"
CDONTS.HtmlBody = CDONTS.HtmlBody & "<meta http-equiv=""Content-Type" " content=""text/html; charset=windows-874""></he ad><body>"
CDONTS.HtmlBody = CDONTS.HtmlBody & "<font color=blue size=5><b><u>Received Customer Comment</b></u></font><br> <br>"
CDONTS.HtmlBody = CDONTS.HtmlBody & "Customer Name : <font color=red>"&Request.Form(" NAME")&"</ font><br>" &_
"Customer E-Mail : <font color=red>"&Request.Form(" EMAIL")&"< /font><br> "&_
"Customer Phone Number : <font color=red>"&Request.Form(" PHONE")&"< /font><br> "&_
"Received At : <font color=red>"&Now&"</font><b r>"&_
"Customer Comment : <font color=red>"&Request.Form(" COMMENT")& "</font><b r>"&_
"<br>--------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- -----<br>" &_
"body></html>"
%>
<%
CDONTS.Send
%>
Nothing was sent ....
I also tested the code with <%@codepage=65001%> at the first row . nothing was sent also
<%@codepage=874%>
<%
Set CDONTS = Server.CreateObject("CDO.M
CDONTS.From = "......"
CDONTS.To = ".........."
CDONTS.Subject = "Customer Comment Sent At "&Now
CDONTS.HtmlBody = "<html><head>"
CDONTS.HtmlBody = CDONTS.HtmlBody & "<meta http-equiv=""Content-Type"
CDONTS.HtmlBody = CDONTS.HtmlBody & "<font color=blue size=5><b><u>Received Customer Comment</b></u></font><br>
CDONTS.HtmlBody = CDONTS.HtmlBody & "Customer Name : <font color=red>"&Request.Form("
"Customer E-Mail : <font color=red>"&Request.Form("
"Customer Phone Number : <font color=red>"&Request.Form("
"Received At : <font color=red>"&Now&"</font><b
"Customer Comment : <font color=red>"&Request.Form("
"<br>---------------------
"body></html>"
%>
<%
CDONTS.Send
%>
Nothing was sent ....
I also tested the code with <%@codepage=65001%> at the first row . nothing was sent also
no error?
ASKER
yes, no error.
try jsut putting it in the HTML and removing the codepage
ASKER
OK now ..
<%@codepage=65001%> works !!
it was an error at the ".........."
sorry 'bout that
thanks anyway and I raised the point to 250.
Thanks very much
<%@codepage=65001%> works !!
it was an error at the ".........."
sorry 'bout that
thanks anyway and I raised the point to 250.
Thanks very much