472,983 Members | 2,407 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,983 software developers and data experts.

sending emails with hebrew characters.

Hello,
I am sending emails with Hebrew contents.

When receiving emails - I cannot see the Hebrew characters (it is not
outlook express configuration, because when receiving emails from friends -
I see hebrew, it is just sending by myself using *.aspx scripts).

In web.config I have the following :
<configuration>
<system.web>
<identity impersonate="true"/>
<globalization
requestEncoding="windows-1255"
responseEncoding="windows-1255"
fileEncoding="windows-1255"
culture="he-IL"
uiCulture="he-IL"
/>
</system.web>
</configuration>

In the aspx I have :

<html>

<head>

<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="TEXT/HTML; CHARSET=WINDOWS-1255">

</head>
.....

But is there anything else I should configure ?
Thanks :)
Nov 18 '05 #1
2 9105


Mr. x wrote:
I am sending emails with Hebrew contents.

When receiving emails - I cannot see the Hebrew characters (it is not
outlook express configuration, because when receiving emails from friends -
I see hebrew, it is just sending by myself using *.aspx scripts).

In web.config I have the following :
<configuration>
<system.web>
<identity impersonate="true"/>
<globalization
requestEncoding="windows-1255"
responseEncoding="windows-1255"
fileEncoding="windows-1255"
culture="he-IL"
uiCulture="he-IL"
/>
</system.web>
</configuration>

In the aspx I have :

<html>

<head>

<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="TEXT/HTML; CHARSET=WINDOWS-1255">

</head>
....

But is there anything else I should configure ?


Those configurations are probably not in any way relevant. How do you
send the mail message? If you use
System.Web.Mail.MailMessage
to construct the email message then you can set
message.BodyEncoding
to specify the encoding for the message body.

For instance with the following ASP.NET page saved as UTF-8

<%@ Page Language="C#" %>
<%@ Import Namespace="System.Web.Mail" %>
<script runat="server">
void TestMailSending () {
MailMessage mail = new MailMessage();
mail.To = "XX*@XXX.XXX";
mail.From = "XX*@XXX.XXX";
mail.Subject = "Test to send mail with encoding Windows-1255";
mail.BodyFormat = MailFormat.Text;
mail.BodyEncoding = System.Text.Encoding.GetEncoding(1255);
mail.Body = "הו";
SmtpMail.SmtpServer = "XXX";
SmtpMail.Send(mail);
}
void Page_Load () {
TestMailSending();
Response.Write("<p>Sent one mail.</p>");
}
</script>

I get a text mail with the header

Content-Type: text/plain;
charset="windows-1255"

However I can't certify that sending Hebrew characters as Windows-1252
really works as I am not sure my newsreader handles that encoding correctly.

When I try to send the mail as UTF-8 however it works, the Hebrew
characters are displayed as far as I can tell:

<%@ Page Language="C#" %>
<%@ Import Namespace="System.Web.Mail" %>
<script runat="server">
void TestMailSending () {
MailMessage mail = new MailMessage();
mail.To = "XXX";
mail.From = "XXX";
mail.Subject = "Test to send mail with Hebrew characters with
encoding UTF-8";
mail.BodyFormat = MailFormat.Text;
mail.BodyEncoding = System.Text.Encoding.UTF8;
mail.Body =
"Test mail:\nHebrew letter HE \u05D4 \nHebrew letter VAV \u05D5";
SmtpMail.SmtpServer = "XXX";
SmtpMail.Send(mail);
}
void Page_Load () {
TestMailSending();
Response.Write("<p>Sent one mail.</p>");
}
</script>

--

Martin Honnen
http://JavaScript.FAQTs.com/

Nov 18 '05 #2
> Those configurations are probably not in any way relevant. How do you
send the mail message? If you use
System.Web.Mail.MailMessage
to construct the email message then you can set
message.BodyEncoding
to specify the encoding for the message body.

For instance with the following ASP.NET page saved as UTF-8

<%@ Page Language="C#" %>
<%@ Import Namespace="System.Web.Mail" %>
<script runat="server">
void TestMailSending () {
MailMessage mail = new MailMessage();
mail.To = "XX*@XXX.XXX";
mail.From = "XX*@XXX.XXX";
mail.Subject = "Test to send mail with encoding Windows-1255";
mail.BodyFormat = MailFormat.Text;
mail.BodyEncoding = System.Text.Encoding.GetEncoding(1255);
mail.Body = "";
SmtpMail.SmtpServer = "XXX";
SmtpMail.Send(mail);
}
void Page_Load () {
TestMailSending();
Response.Write("<p>Sent one mail.</p>");
}
</script>

I get a text mail with the header

Content-Type: text/plain;
charset="windows-1255"

However I can't certify that sending Hebrew characters as Windows-1252
really works as I am not sure my newsreader handles that encoding correctly.
When I try to send the mail as UTF-8 however it works, the Hebrew
characters are displayed as far as I can tell:

<%@ Page Language="C#" %>
<%@ Import Namespace="System.Web.Mail" %>
<script runat="server">
void TestMailSending () {
MailMessage mail = new MailMessage();
mail.To = "XXX";
mail.From = "XXX";
mail.Subject = "Test to send mail with Hebrew characters with
encoding UTF-8";
mail.BodyFormat = MailFormat.Text;
mail.BodyEncoding = System.Text.Encoding.UTF8;
mail.Body =
"Test mail:\nHebrew letter HE \u05D4 \nHebrew letter VAV \u05D5";
SmtpMail.SmtpServer = "XXX";
SmtpMail.Send(mail);
}
void Page_Load () {
TestMailSending();
Response.Write("<p>Sent one mail.</p>");
}
</script>


Thanks Martin - It works :)
Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Shmuel | last post by:
How can I output hebrew ? I have tried to make php script to write hebrew, but it can't do it, why? I tried to put put this line in the beginning of the script: <meta http-equiv=Content-Type...
1
by: Laurence Neville | last post by:
This is regarding a change in the Short Date format under Hebrew Regional Settings, that has caused huge problems in our ASP web application. The change appears to have been introduced sometime...
1
by: Saul | last post by:
Hello, I have text file (DOS) with hebrew characters on it. When I am importing the file into access db, the characters "(" are swapped with ")" (there are many characters that are swapped). I...
2
by: Ben Kayam | last post by:
Hello, I have a hebrew string that include numbers and other letters, i need to revere only the hebrew fonts. somebody told me using the bidi. please help me.
0
by: Ryan | last post by:
Outlook problem with encoding characters when sending emails in asp.net I'm putting this out here incase someone has the same problem I did.. I had a problem with German characters not showing...
0
by: Julia | last post by:
Hi, I am trying to POST values from WINFORM application to ASP(not ASP.NET) page,which save them in ACCESS data base(support unicode) The values contains Hebrew and English characters no...
7
by: Elie Nacache | last post by:
Hi all, I develop an application (JAVA/JSP) on RedHat PostgreSQL 7.4.3 with PostgreSQL 7.4.2 JDBC3 with SSL (build 213). This application needs to serve pages in LATIN1 and Hebrew. For that I...
40
by: Shmuel (Seymour J.) Metz | last post by:
I'd like to include some Hebrew names in a web page. HTML 4 doesn't appear to include character attributes for ISO-8859-8. I'd prefer avoiding numeric references, e.g.,...
2
by: Etayki | last post by:
Hi! I am trying to print Hebrew characters: Module Module1 Sub Main() Console.WriteLine("איתי")
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.