This is Russian, but I have the same problems in Greek, Portugese, or any other language that requirese UFT-8 characters. The restults in this case with a First name of "Example" and a Last Name of "Results" is:
=======
<div>Example Results
Свет и Любовь</div> <div></div> <div>=======</div> <div></div> <div>I have checked strTextBody with Response.Write, Response.End and it's fine on the site itself. The:</div> <div></div> <div> objEmail.TextBodyPart.CharSet = "UTF-8"</div> <div></div>
<div>line makes no different, but thought I would try it.</div> <div></div> <div>At this point I have no idea where to go or what to try next. Thanks greatly for any suggestions. Rick</div>
If you are using ASP.NET (pages end in .aspx) you should be using
System.Net.Mail, not the old COM-based CDO library. If your pages end in .asp, this is the wrong forum. Try here: http://forums.iis.net/1032.aspx
shiesl
Member
2 Points
13 Posts
CDO email bodytext encoding problem
Mar 19, 2012 02:02 PM|LINK
I've been working on this for the past week straight without any results. Here's the code:
=======
Set objEmail = CreateObject("CDO.Message")
Set objBodyPart = objEmail.BodyPart
objBodyPart.Charset = "UTF-8"
Dim strTextBody
' Start the email text
strTextBody = chr(10)
strTextBody = strTextBody & strFirst_Name & " " & strLast_Name & chr(10)
strTextBody = strTextBody & chr(10)
strTextBody = strTextBody & "Свет и Любовь" & chr(10)
objEmail.From = "xxxxxxx@xxxxxxx.com"
objEmail.To = strEmail_Address
objEmail.Textbody = strTextBody
objEmail.TextBodyPart.CharSet = "UTF-8"
objEmail.Bcc = "xxxxxxx@xxxxxxx.com"
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "xxxxxxx.com"
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") = "xxxxxxx@xxxxxxx.com"
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "xxxxxxx"
objEmail.Configuration.Fields.Update
objEmail.Send
=======
This is Russian, but I have the same problems in Greek, Portugese, or any other language that requirese UFT-8 characters. The restults in this case with a First name of "Example" and a Last Name of "Results" is:
=======
<div>Example ResultsСвет и Любовь</div> <div></div> <div>=======</div> <div></div> <div>I have checked strTextBody with Response.Write, Response.End and it's fine on the site itself. The:</div> <div></div> <div> objEmail.TextBodyPart.CharSet = "UTF-8"</div> <div></div> <div>line makes no different, but thought I would try it.</div> <div></div> <div>At this point I have no idea where to go or what to try next. Thanks greatly for any suggestions. Rick</div>
Mikesdotnett...
All-Star
154818 Points
19853 Posts
Moderator
MVP
Re: CDO email bodytext encoding problem
Mar 19, 2012 04:52 PM|LINK
If you are using ASP.NET (pages end in .aspx) you should be using System.Net.Mail, not the old COM-based CDO library. If your pages end in .asp, this is the wrong forum. Try here: http://forums.iis.net/1032.aspx
Beginning ASP.NET Web Pages with WebMatrix | My Site | Twitter
shiesl
Member
2 Points
13 Posts
Re: CDO email bodytext encoding problem
Mar 19, 2012 05:39 PM|LINK
Thanks. It seems I posted then in the wrong forum. My fault and I appreciate the correction. Rick