Note that there are some explanatory texts on larger screens.

plurals
  1. POEncoding issue with email sent from form in ASP with Hebrew text
    text
    copied!<p>I'm using <code>CDO.Message</code> to send emails from a contact form on an ASP Classic website to the site owner. The site is in Hebrew and I've encoded everything with <code>UTF-8</code>.</p> <p>My problem is that in Outlook 2007 the Hebrew sent from the form comes out in gibberish. Other text in Hebrew in the email (ie. hardcoded text) displays correctly.</p> <p>I've checked these emails in Outlook 2010 and online at Gmail and all the Hebrew looks fine.</p> <p>Of course my client has Outlook 2007 and is not likely to change anytime soon.</p> <p>Does anyone know how I can fix this?</p> <p>Here is the script for sending the emails:</p> <pre class="lang-vb prettyprint-override"><code>Const CdoReferenceTypeName = 1 Dim objCDO, objBP Set objCDO = Server.CreateObject("CDO.Message") objCDO.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 objCDO.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost" objCDO.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 objCDO.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False objCDO.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 objCDO.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication objCDO.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = "aaaa@bbbbb.co.il" objCDO.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "123456" objCDO.Configuration.Fields.Update objCDO.MimeFormatted = True objCDO.To = email_to objCDO.Bcc = email_bcc objCDO.From = email_from objCDO.Subject = email_subject objCDO.HTMLBody = email_body objCDO.HTMLBodyPart.charset = "utf-8" objCDO.BodyPart.charset = "utf-8" objCDO.Send </code></pre> <p>The form is submitted via the jquery malsup form plugin thus :</p> <pre><code>$('#contact_form').submit(function() { if (myvalidator.isValid()) { $(this).ajaxSubmit(function() { $('#form_holder').html('thanks'); }); } return false; }); </code></pre> <p>The form also has an attachment so is sent thusly: </p> <pre><code>&lt;form action="inc_contact_send.asp" method="post" enctype="multipart/form-data" id="contact_form"&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload