Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CDO.Message and utf-8

1,057 views
Skip to first unread message

fixertool

unread,
Apr 10, 2008, 12:59:59 PM4/10/08
to
I use the code below for sending automatic mails, working with asp
classic pages. It works fine, but when you try to send some utf-8
text, fails showing the usual weird unreadable text. I can't find the
way to solve it.
For example, I tried (.BodyPart.charset = utf-8) inside the With...End
With but still doesn't work.
Any suggestion? Thanks in advance

Set iConf = CreateObject("CDO.Configuration")
With iConf
.Fields.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Fields.Item(cdoSMTPServer) = "xxx.xxx.xxx"
.Fields.Update
End With

Set iMsg = CreateObject("CDO.Message")
With iMsg
Set .Configuration = iConf
.To = "some.recipient"
.From = "some.sender"
.Subject = "some subject"
.TextBody = "some text"
.Send
End With

Set iConf = Nothing
Set iMsg = Nothing

abel...@gmail.com

unread,
Apr 23, 2008, 3:19:08 AM4/23/08
to
Tested with MSO 2003:

Set objEmail = CreateObject("CDO.Message")
Set objBodyPart = objEmail.BodyPart

objBodyPart.Charset = "UTF-8"
objEmail.From = "xx...@xxxxxxx.xx"
objEmail.To = "xxx...@xxxxxx.xxxx"
objEmail.Subject = "Some subj Например по-русски"
objEmail.Textbody = "Some body: и снова что=то написано"

objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
"mail.al-domains.com"
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
= 25
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") =
"x...@xxxxx.xxx"
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") =
"xxxxxxx"
objEmail.Configuration.Fields.Update

objEmail.Send

0 new messages