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.M essage")
If IsObject (objMail) Then
'Set key properties
objMail.From = sFrom
objMail.To = sTo
objMail.Subject= sSubject
objMail.HTMLBody = strBody2
objMail.TextBodyPart.Chars et = "big5"
objMail.HTMLBodyPart.Chars et = "big5"
objMail.TextBodyPart.Conte ntTransfer Encoding = "quoted-printable"
objMail.HTMLBodyPart.Conte ntTransfer Encoding = "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
%>
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.M
If IsObject (objMail) Then
'Set key properties
objMail.From = sFrom
objMail.To = sTo
objMail.Subject= sSubject
objMail.HTMLBody = strBody2
objMail.TextBodyPart.Chars
objMail.HTMLBodyPart.Chars
objMail.TextBodyPart.Conte
objMail.HTMLBodyPart.Conte
'Send the email
objMail.Send
'Clean-up mail object
Set objMail = Nothing
Response.Write("Message sent")
Else
Response.Write("Message not sent")
End If
%>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
using
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
+
objMail.SetLocaleIDs(65001
thanks!