?
Solved

email & hebrew

Posted on 2008-01-24
18
Medium Priority
?
765 Views
Last Modified: 2013-11-30
i am tring to build a regular form in wich will be send to some email after submition...
but when i am typing hebrew inside the form and use this code, i got some '×>×' ×'×>×"×' gibberish
, i am not a big expert in hebrew but it sure not looks like it...
the page that set the form set as <meta http-equiv="content-type" Content="text/html;charset=utf-8">
and same as with the page that sends the emails...
<%


dim xdep,xmsg
xdep = request.form("ondep")
xmsg = request.form("onmsg")

if xmsg<>"" then

Set objEmail = Server.CreateObject("Persits.MailSender")

objEmail.Username = "emailname"
objEmail.Password = "pass"
objEmail.Host = "host"
objEmail.From = "frommail"
objEmail.AddAddress "to mail"

objEmail.Subject = "var1:" & xdep & "var2:" & xmsg

objEmail.body = "var1:" & xdep & "var2:" & xmsg

objEmail.Send

Set objEmail = Nothing

response.redirect "contactus.htm"

end if
%>


how can i build it inside html in order to pass it normaly?
0
Comment
Question by:sasha85
  • 10
  • 5
  • 3
18 Comments
 
LVL 14

Assisted Solution

by:_Stilgar_
_Stilgar_ earned 1600 total points
ID: 20740966
If I understand you correctly the issue is with the emails that get sent with your code - they appear in gibberish.

Try using other email components (try Windows standard - CDONTS and similar) to see how they send the email. If you get the same results its an issue with your server (or with your code -- but what you pasted here looks fine). If you don't, Persits probably have a bug with UTF8 strings...

Stilgar.
0
 

Author Comment

by:sasha85
ID: 20741006
but when i use:
strBodyPath = Server.MapPath("\folder") & "\mailbody.asp"
objEmail.AppendBodyFromFile strBodyPath

strImagePath = Server.MapPath("\folder\web") & "\welogo.jpg"
objEmail.AddEmbeddedImage strImagePath, "imgfl"

the page mailbody.asp
that is written in hebrew is sent ok...with nice hebrew...
the problem is that i don't know how to pass my variables into it...


mailbody.asp
<HTML>
<HEAD>
<STYLE>BODY {
COLOR: #427d64; FONT-FAMILY: "Arial"; FONT-SIZE: 12pt; MARGIN-LEFT: 8em
}
</STYLE>
</HEAD>
<BODY>
<CENTER>
<IMG SRC="cid:imgfl" BORDER=0></A>
</CENTER>
</BODY>
</HTML>

0
 
LVL 3

Assisted Solution

by:RobbP
RobbP earned 400 total points
ID: 20741021
Hi

It works on mine, then either it's the host configuration or there's a problem with the
Mailer.AddAddress "sherice@mascotartist.com"
Mailer.Host = "mail.mascotartist.com"
lines.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 

Author Comment

by:sasha85
ID: 20741041
as in that code
strBodyPath = Server.MapPath("\folder") & "\mailbody.asp"
objEmail.AppendBodyFromFile strBodyPath

strImagePath = Server.MapPath("\folder\web") & "\welogo.jpg"
objEmail.AddEmbeddedImage strImagePath, "imgfl"


can i set a variable and view it with the icluded file?

something like:

strvar1path = xmsg
objEmail.AddEmbeddedImage strvar1path, "pvar1"

and use it inside the icluded file like
<=cid:pvar1> ?
0
 
LVL 14

Accepted Solution

by:
_Stilgar_ earned 1600 total points
ID: 20741045
Try this:

mailbody.asp
<HTML>
<HEAD>
<STYLE>BODY {
COLOR: #427d64; FONT-FAMILY: "Arial"; FONT-SIZE: 12pt; MARGIN-LEFT: 8em
}
</STYLE>
</HEAD>
<BODY>
%body%
<CENTER>
<IMG SRC="cid:imgfl" BORDER=0></A>
</CENTER>
</BODY>
</HTML>

And in your code:
strBodyPath = Server.MapPath("\folder") & "\mailbody.asp"
objEmail.AppendBodyFromFile strBodyPath
objEmail.body = Replace(objEmail.body, "%body%", request.form("somevar"))

If this still returns gibberish there is some configuration issues with the server. I've had similar issues in the past with Hebrew sites that were hosted on server which did not recognize it, mainly with DBs like MySQL and MsSQL. Could be that the issue you have is with IIS encoding misconfiguration.

Stilgar.
0
 
LVL 14

Expert Comment

by:_Stilgar_
ID: 20741053
Also, check an option to load a page using URL, and then pass the variables as query string values.

Stilgar.
0
 
LVL 3

Expert Comment

by:RobbP
ID: 20741079
It sounds like unicode, try setting these:

Check out this site, you may want to look at 'IsHTML', or 'Charset'.
http://www.ipower.be/en/manual/asp/ASPEmail.aspx
0
 

Author Comment

by:sasha85
ID: 20741129
stilgar, i tried your code...that originaly what i wanted to do...but i get a mail with %body%
it just print the %body%...
is that the right syntax for displaying variables?

about the querystring...that was my first shot...it won't work...
0
 

Author Comment

by:sasha85
ID: 20741167
there is no database involved...it just a form bing submited...
and when i sent it i get the subject in hebrew, the body in utf and the strBodyPath in hebrew too...
that's why i like stilgar's idea...but there is syntax problem with it...
0
 

Author Comment

by:sasha85
ID: 20741182
even if there is problems with hebrew on the server...that not means that there is not a way doing this withembed inside html...the question is how to do this...
0
 

Author Comment

by:sasha85
ID: 20741248
i aborted the ship...i tried IPWorks and jmail and they both good:)
what shell i choose than? what is better?
0
 
LVL 14

Expert Comment

by:_Stilgar_
ID: 20741337
I like JMail better. Obviously Persists component wasn't configured well..

Stilgar.
0
 
LVL 3

Expert Comment

by:RobbP
ID: 20741346
JMail
0
 

Author Comment

by:sasha85
ID: 20741348
IPWorks is not persist component...is there any reason you like jmail batter?
is it involved secure reasons?
i heard that there are ways to read mails that send via those components....?
0
 

Author Comment

by:sasha85
ID: 20741368
in jmail, why do i need to use objEmail.AddRecipient
if i am not using it gives me error
0
 

Author Comment

by:sasha85
ID: 20741384
is there a way in jmail to include file like in aspemail?
strBodyPath = Server.MapPath("\folder") & "\mailbody.asp"
objEmail.AppendBodyFromFile strBodyPath

strImagePath = Server.MapPath("\folder\web") & "\welogo.jpg"
objEmail.AddEmbeddedImage strImagePath, "imgfl"
0
 
LVL 14

Assisted Solution

by:_Stilgar_
_Stilgar_ earned 1600 total points
ID: 20741399
I honestly don't remember much of it. They have excellent documentation though.

http://www.dimac.net/Products/w3JMail/Manuals/w3_JMail.pdf

Stilgar.
0
 

Author Comment

by:sasha85
ID: 20741402
great!:) thank u all
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Question has a verified solution.

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

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Check out the latest tech news, community articles, and expert highlights in August's newsletter.
Kernel Data Recovery is a renowned Data Recovery solution provider which offers wide range of softwares for both enterprise and home users with its cost-effective solutions. Let's have a quick overview of the journey and data recovery tools range he…
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…
Suggested Courses

600 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