473,386 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 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 9184


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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.