Connecting Tech Pros Worldwide Forums | Help | Site Map

sending unicode email

Newbie
 
Join Date: Feb 2009
Posts: 23
#1: Jun 29 '09
i want to send Unicode email in asp by CDOSYS

first i design my template in temp.htm
i add this line:
Expand|Select|Wrap|Line Numbers
  1. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
then i save temp.htm as temp.txt and change encoding as utf-8

when i want to send email i replace some text in temp.txt by replace function (replaced text come from database and all database field are unicode)

i add this line to all my asp page:
Expand|Select|Wrap|Line Numbers
  1. <%@ CodePage=65001  %>
when i want to send email use following code:
Expand|Select|Wrap|Line Numbers
  1. Set myMail=CreateObject("CDO.Message")
  2. myMail.Subject="unicode subject"
  3. myMail.From="some@some.txt"
  4. myMail.To=r"some@some.txt"
  5. myMail.HTMLBody = emailtext
  6. myMail.Send
  7. set myMail=nothing
after send i check my mail:
replaced text were WordCap
original Text were displayed correctly
subject was WordCap

after i add this line:
myMail.BodyPart.charset = "UTF-8"
subject was displayed correctly but replaced text were WordCap still

after i add this line:
myMail.HTMLBody.charset = "UTF-8"
this error Displayed:
Microsoft VBScript runtime error '800a01a8'
Object required: '[string: "<html dir="rtl"> "]'
/send.asp, line 35

Newbie
 
Join Date: Feb 2009
Posts: 23
#2: Jun 29 '09

re: sending unicode email


after send i user response.write command to view text in my browser. A strange event happenedو Everything was contrary:
Original text were WordCap
replaced Text was displayed correctly
Reply