title: How to fix sending e-mail Thai language text?
body: <p>I've try to send Thai language e-mail through .asp (classic) page. The code is below</p>
  
  <pre><code>&lt;%
  response.write(GetLocale() &amp; "&lt;br /&gt;")
  SetLocale(1054)
  response.write(GetLocale())
  
  
  Set Mail = CreateObject("CDO.Message")
  
  Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
  Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="smtp.gmail.com"
  Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
  
  Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = 1
  
  Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
  
  Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
  Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="xxx@gmail.com"
  Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="xxx"
  
  Mail.Configuration.Fields.Update
  
  Mail.Subject="ระบบแจ้งเตือนอัตโนมัติ"
  Mail.From="xxx@gmail.com"
  Mail.To="xxx@hotmail.com"
  Mail.TextBody="สวัสดี"
  
  
  
  Mail.Send
  Set Mail = Nothing
  
  %&gt;
  </code></pre>
  
  <p>but the result e-mail I get is </p>
  
  <blockquote>
    <p>????? ???????????????????? ???????????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????? </p>
  </blockquote>
  
  <p>Any body know how to fix, please help?</p>
  
  <p><strong>Ways to fix are (by ulluoink below)</strong></p>
  
  <p>Add this little-known bit-o-goodness to your pages:</p>
  
  <pre><code>Response.CodePage = 65001
  Response.CharSet = "utf-8"
  </code></pre>
  
  <p>Change xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;.
  </code></pre>
  
  <p>You might also ensure your META tags don't lie:</p>
  
  <pre><code>&lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
  </code></pre>
  
  <p>And use this code pattern:</p>
  
  <pre><code>&lt;%
  function TestEMail(sFrom, sTo, sSubject, sBody,  sBcc)
      Set objMail = Server.CreateObject("CDO.Message")
      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")  =  "mail.secureserver.net"
          .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10 
          .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
          .Update 
      End With
  
      With objMail
          Set .Configuration = objConf
          .BodyPart.Charset = "utf-8"
          .From = sFrom
          .To = sTo
          .Subject = sSubject
          .TextBody = sBody
          if sBcc &lt;&gt; "" then .Bcc = sBcc
          End With
  
      objMail.Send
      Set objFields = Nothing
      Set objConf = Nothing
      Set objMail = Nothing
  End function
  %&gt;
  </code></pre>