Professional Web Applications Themes

CDO.Message and UTF-8 Issue - ASP

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 ...

  1. #1

    Default 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 cht 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.Cht = "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 cht?

    Thanks!
    polsynth@gmail.com Guest

  2. #2

    Default Re: CDO.Message and UTF-8 Issue

    On 26 ובמבר 2008, 03:57, polsy... wrote:
    > 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 cht 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.Cht = "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 cht?
    >
    > Thanks!
    set HTMLBodyPart and TextBodyPart Cht too
    asaf.meir.barziv@gmail.com Guest

Similar Threads

  1. How To Supress Acrobat Error Message And Alert Message
    By ckpang@adobeforums.com in forum Adobe Acrobat SDK
    Replies: 10
    Last Post: January 15th, 11:33 AM
  2. Replies: 4
    Last Post: March 23rd, 12:56 AM
  3. Newsgroup Issue - Message Unavailable
    By David Bartosik - MS MVP in forum Web Design
    Replies: 0
    Last Post: February 21st, 06:40 PM
  4. Replies: 0
    Last Post: September 21st, 10:36 PM
  5. Replies: 0
    Last Post: September 21st, 10:36 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139