Link to home
Start Free TrialLog in
Avatar of ping1234
ping1234

asked on

sending mail with CDO

Dear all,

I have problem in sending asp mail using CDO object. Please kindly help...

when I view the  mail source, I found the coding scheme have no error..while the content cannot display correctly..no matter which encoding scheme I choose to view the message.. actually I tried unicode as well..but no good at all....

Here are my code:
<%
Dim sMsg
Dim sTo
Dim sFrom
Dim sSubject
Dim sTextBody

sTo = "esther@xxxx.com"
sFrom = "esther@xxxx.com"
sSubject = "testing" 'chinese character here

strBody2="<HTML><HEAD>" & _
"<META http-equiv=Content-Type content=""text/html; charset=big5"">" & _
"</HEAD>" & _
"<BODY bgcolor=#FF941C>" & _
"<font color=#FFFFFF>chinese character here!!!<br><br>"& _
"</BODY></HTML>"                    

Dim objMail
'Create the mail object
Set objMail = Server.CreateObject("CDO.Message")
If IsObject (objMail) Then
'Set key properties
  objMail.From = sFrom
  objMail.To = sTo
  objMail.Subject= sSubject
  objMail.HTMLBody  = strBody2
  objMail.TextBodyPart.Charset = "big5"
  objMail.HTMLBodyPart.Charset = "big5"
  objMail.TextBodyPart.ContentTransferEncoding = "quoted-printable"
  objMail.HTMLBodyPart.ContentTransferEncoding = "quoted-printable"
      
  'Send the email
  objMail.Send
  'Clean-up mail object
  Set objMail = Nothing
  Response.Write("Message sent")
Else
  Response.Write("Message not sent")
End If

%>
Avatar of ping1234
ping1234

ASKER

I have solved the problem by myself..here is the answer

using
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
+
objMail.SetLocaleIDs(65001)


thanks!

ASKER CERTIFIED SOLUTION
Avatar of modulo
modulo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial