Ask a Question related to ASP, Design and Development.
-
polsynth@gmail.com #1
CDO.Message and UTF-8 Issue
I have vbscript (ASP) code that sends emails using information passed
into the script from a Flash component. The information is escaped
using Flash's escape function so I receive the values properly and
then decode them.
I can display the decoded information correctly in a web browser using
UTF-8 encoding on the web page, however when I send the information
via email the unicode values in the message body show the "funny"
characters instead of what I expect. For example, when I look at the
email sent by the script I see these three characters — instead of
the em dash.
I've tried setting the charset for the email but it doesn't seem to
have any effect.
Here's the my code:
Set objMail = Server.CreateObject("CDO.Message")
Set objBodyPart = objmail.BodyPart
objBodyPart.Charset = "UTF-8"
Set objConf = Server.CreateObject("CDO.Configuration")
Set objFields = objConf.Fields
With objFields
.Item("http://schemas.microsoft.com/cdo/configuration/
sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/
smtpserver") = "localhost"
.Item("http://schemas.microsoft.com/cdo/configuration/
smtpconnectiontimeout") = 20
.Item("http://schemas.microsoft.com/cdo/configuration/
smtpserverport") = 25
.Update
End With
With objMail
Set .Configuration = objConf
.From = email
.To = Trim(recip)
.Subject = subject
.TextBody = txtboilerplate 'the txtboilerplate contains the
unicode chars
End With
objMail.Send
Set objFields = Nothing
Set objConf = Nothing
Set objMail = Nothing
Is there something wrong with how I'm trying to set the charset?
Thanks!
polsynth@gmail.com Guest
-
How To Supress Acrobat Error Message And Alert Message
Is there any way to supress those pop up message? If can't, is there any way to catch it? -
Error Message When Sending Message In Windows Mail
Am I the only one getting an error message when replying to a posted message using Windows Mail. Every time I send a message I get a popup error... -
Newsgroup Issue - Message Unavailable
The newsgroups are having an issue at this time whereby responses may display "message unavailable". You may try again at a later time or... -
***This message may contains virus****Delete the message***Taste this correction pack for MS Internet Explorer
"If you receive an e-mail that claims to contain software from Microsoft, do not run the attachment. The safest course of action is to delete the... -
***This message may contains virus****Delete the message***Taste this correction pack for MS Internet Explorer
"If you receive an e-mail that claims to contain software from Microsoft, do not run the attachment. The safest course of action is to delete the... -
asaf.meir.barziv@gmail.com #2
Re: CDO.Message and UTF-8 Issue
On 26 ×*ובמבר 2008, 03:57, polsy...@gmail.com wrote:
set HTMLBodyPart and TextBodyPart Charset too> I have vbscript (ASP) code that sends emails using information passed
> into the script from a Flash component. The information is escaped
> using Flash's escape function so I receive the values properly and
> then decode them.
>
> I can display the decoded information correctly in a web browser using
> UTF-8 encoding on the web page, however when I send the information
> via email the unicode values in the message body show the "funny"
> characters instead of what I expect. For example, when I look at the
> email sent by the script I see these three characters — instead of
> the em dash.
>
> I've tried setting the charset for the email but it doesn't seem to
> have any effect.
>
> Here's the my code:
>
> Â* Â* Â* Â* Â* Set objMail = Server.CreateObject("CDO.Message")
> Â* Â* Â* Â* Â* Set objBodyPart = objmail.BodyPart
> Â* Â* Â* Â* Â* objBodyPart.Charset = "UTF-8"
>
> Â* Â* Â* Â* Â* Set objConf = Server.CreateObject("CDO.Configuration")
> Â* Â* Â* Â* Â* Set objFields = objConf.Fields
>
> Â* Â* Â* Â* Â* With objFields
> Â* Â* Â* Â* Â* Â* Â* .Item("http://schemas.microsoft.com/cdo/configuration/
> sendusing") = 2
> Â* Â* Â* Â* Â* Â* Â* .Item("http://schemas.microsoft.com/cdo/configuration/
> smtpserver") Â*= "localhost"
> Â* Â* Â* Â* Â* Â* Â* .Item("http://schemas.microsoft.com/cdo/configuration/
> smtpconnectiontimeout") = 20
> Â* Â* Â* Â* Â* Â* Â* .Item("http://schemas.microsoft.com/cdo/configuration/
> smtpserverport") = 25
> Â* Â* Â* Â* Â* Â* Â* .Update
> Â* Â* Â* Â* Â* End With
>
> Â* Â* Â* Â* Â* With objMail
> Â* Â* Â* Â* Â* Â* Â* Set .Configuration = objConf
> Â* Â* Â* Â* Â* Â* Â* .From = email
> Â* Â* Â* Â* Â* Â* Â* .To = Trim(recip)
> Â* Â* Â* Â* Â* Â* Â* .Subject = subject
>
> Â* Â* Â* Â* Â* Â* Â* .TextBody = txtboilerplate Â* 'the txtboilerplate contains the
> unicode chars
> Â* Â* Â* Â* Â* End With
>
> Â* Â* Â* Â* Â* objMail.Send
> Â* Â* Â* Â* Â* Set objFields = Nothing
> Â* Â* Â* Â* Â* Set objConf = Nothing
> Â* Â* Â* Â* Â* Set objMail = Nothing
>
> Is there something wrong with how I'm trying to set the charset?
>
> Thanks!
asaf.meir.barziv@gmail.com Guest



Reply With Quote

