Solved

Problem sending HTML Jmail email with hebrew content

Posted on 2007-04-07
4
708 Views
Last Modified: 2012-06-21
hi,
i'm building a simple newsletter system for a client using asp, access and Jmail. the user enters text and uploads images. everything is in hebrew and i'm using utf-8 encoding.

i encounter problems when i try and send the template page with the relevant dynamic data as a HTML email... all the hebrew text comes out as screwed up characters (המשכן as an example... of course i have to presume you'll see the same as me here: gobbledigook).

below is a snippet of the code i'm using ... the line which defines the content of the mail is

msgTemplate.GetMessageBodyFromURL "http://xxx.bob.co.il/newsletter1.asp?id="&varID

this page displays correctly if viewed with the browser, but when mailed it scrambles the text.

here is the code :

 set msgTemplate = Server.CreateObject( "JMail.Message" )
 msgTemplate.From = "info@bob.co.il"
 msgTemplate.FromName = "Bob."
msgTemplate.AddRecipient "%%email%%"
msgTemplate.Subject = Request.Cookies("subject")

msgTemplate.ContentType = "text/html; charset=UTF-8"
'msgTemplate.ContentTransferEncoding = "65001"
'msgTemplate.ContentType = "text/html"
msgTemplate.Charset = "utf-8"

msgTemplate.GetMessageBodyFromURL "http://xxx.bob.co.il/newsletter1.asp?id="&varID

set mMerge = Server.CreateObject( "JMail.MailMerge" )
mMerge.MailTemplate = msgTemplate

msgTemplate.MailServerUserName = "obo@bob.co.il"
msgTemplate.MailServerPassword = "bob"
msgTemplate.Silent = True
   msgTemplate.Logging = True
 mMerge.BulkMerge  rs, false, "mail.bob.co.il"
Response.Write("<br><br>mail sent")

any suggestions ?

cheers

dog
0
Comment
Question by:dog_star
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 11

Accepted Solution

by:
kelvinwkw earned 250 total points
ID: 18871876
use server.htmlencode()
0
 

Author Comment

by:dog_star
ID: 18872104
thanks for the reply... not sure if i've applied your suggestion correctly but i tried this :

varURL =   "http://xxx.bob.co.il/newsletter1.asp?id="&varID
varURL =  server.htmlencode(varURL)
msgTemplate.GetMessageBodyFromURL varURL

and get the same results as before (ie strange characters in the mail)...
0
 

Author Comment

by:dog_star
ID: 18872119
ah right, found what you meant... use the server.htmlencode on the template page to encode the dynamic data.... silly i didn't get what you meant...

encoding the data works perfect... many thanks....
0
 

Author Comment

by:dog_star
ID: 18873034
ok, it was close to perfect..... now all the hebrew dynamic text displays correctly, but the static text is still garbled.... i've tried putting the static text like this but it yields the same results :

<%=Server.HTMLEncode(Response.Write("hebrew text here"))%>

any suggestions for getting the rest to display correctly?

or should i post this as a new question....

cheers

dog
0

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Show MP4 file and close (HTA) 3 43
Application.cfm not found issue 2 64
Level out logo and increase size? 16 51
Boolean 13 50
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question