hml
|
journeyman
|
|
|
|
Рег.: 15.09.2005
|
Сообщений: 69
|
|
Рейтинг: 0
|
|
a C#program sending a message in Russian
08.09.2006 19:12
|
|
|
Hello anybody. I'm have a problem with programm sending a message in Russian in c#.
I wrote small program sending a English message here : MailMessage mes = new MailMessage(); mes.From = "jessica@myisp.net"; mes.To = "hehe@mail.ru"; mes.Subject = "TEST"; mes.Body = "go"; SmtpMail.SmtpServer = "mail.ru"; SmtpMail.Send(mes);
It work okey. But if i assign mes.Body = "АВАВфцукцуЭ" then mail box hehe@mail.ru receive a empty message, not needed message 'АВАВфцукцуЭ'.
Have anybody met the problem? Help me.
|
|
kaiafa
|
|
|
|
|
Рег.: 17.05.2004
|
Сообщений: 13390
|
Из: Strasbourg, FR
|
Рейтинг: 4
|
|
Re: a C#program sending a message in Russian
[re: hml]
08.09.2006 19:14
|
|
|
I suppose message "АВАВфцукцуЭ" not to be Russian.
|
|
|
KOHTPA
|
Carpal Tunnel
|
|
|
|
Рег.: 22.01.2003
|
Сообщений: 33647
|
|
Рейтинг: 2374
|
|
Re: a C#program sending a message in Russian
[re: hml]
08.09.2006 19:15
|
|
|
Keywords: MIME.
--- Q22: and what does not suck then? A22: Microsoft vacuum-cleaner.
|
|
hml
|
journeyman
|
|
|
|
Рег.: 15.09.2005
|
Сообщений: 69
|
|
Рейтинг: 0
|
|
Re: a C#program sending a message in Russian
[re: kaiafa]
08.09.2006 19:16
|
|
|
I suppose message "АВАВфцукцуЭ" not to be Russian.
why ?
|
|
hml
|
journeyman
|
|
|
|
Рег.: 15.09.2005
|
Сообщений: 69
|
|
Рейтинг: 0
|
|
Re: a C#program sending a message in Russian
[re: hml]
08.09.2006 19:17
|
|
|
the original problem i want to solve is to read the text file ( in russian) and send it to an email.
|
|
Krasin
|
|
|
|
|
Рег.: 23.06.2004
|
Сообщений: 7039
|
Из: Калифорния
|
Рейтинг: 3386
|
|
Re: a C#program sending a message in Russian
[re: hml]
08.09.2006 19:18
|
|
|
Try to set the following properties of MailMessage: code: message.BodyEncoding = System.Text.Encoding.UTF8;
message.SubjectEncoding = System.Text.Encoding.UTF8;
|
|
hml
|
journeyman
|
|
|
|
Рег.: 15.09.2005
|
Сообщений: 69
|
|
Рейтинг: 0
|
|
Re: a C#program sending a message in Russian
[re: Krasin]
08.09.2006 19:22
|
|
|
MailMessage mes = new MailMessage(); mes.From = "jessica@myisp.net"; mes.To = "daywednes@mail.ru"; mes.Subject = "TEST"; mes.Body = "ав"; mes.BodyEncoding = System.Text.Encoding.UTF8; SmtpMail.SmtpServer = "172.16.39.1"; SmtpMail.Send(mes);
and i received an empty message
|
|
KOHTPA
|
Carpal Tunnel
|
|
|
|
Рег.: 22.01.2003
|
Сообщений: 33647
|
|
Рейтинг: 2374
|
|
Re: a C#program sending a message in Russian
[re: hml]
08.09.2006 19:28
|
|
|
> mes.Body = "ав"; > mes.BodyEncoding = System.Text.Encoding.UTF8;
What's the encoding of "ав" string literal? You should have converted this string into UTF-8.
--- Q22: and what does not suck then? A22: Microsoft vacuum-cleaner.
|
|
hml
|
journeyman
|
|
|
|
Рег.: 15.09.2005
|
Сообщений: 69
|
|
Рейтинг: 0
|
|
Re: a C#program sending a message in Russian
[re: KOHTPA]
08.09.2006 19:31
|
|
|
how to convert the string to UTF-8. Please let me know.
|
|
Krasin
|
|
|
|
|
Рег.: 23.06.2004
|
Сообщений: 7039
|
Из: Калифорния
|
Рейтинг: 3386
|
|
Re: a C#program sending a message in Russian
[re: KOHTPA]
08.09.2006 19:34
|
|
|
В ответ на:
You should have converted this string into UTF-8.
You do not know .net, KOHTPA. He should not.
|
|
Krasin
|
|
|
|
|
Рег.: 23.06.2004
|
Сообщений: 7039
|
Из: Калифорния
|
Рейтинг: 3386
|
|
Re: a C#program sending a message in Russian
[re: hml]
08.09.2006 19:40
|
|
|
.net 2.0: code: SmtpClient client = new SmtpClient("smtp.mail.ru");
client.Credentials = new NetworkCredential("myaccount", "mypassword");
MailMessage mes = new MailMessage(
new MailAddress("myaccount@mail.ru"),
new MailAddress("destination@mail.ru"));
mes.Subject = "TEST";
mes.Body = "ав";
mes.BodyEncoding = System.Text.Encoding.UTF8;
client.Send(mes);
It works fine.
|
|
KOHTPA
|
Carpal Tunnel
|
|
|
|
Рег.: 22.01.2003
|
Сообщений: 33647
|
|
Рейтинг: 2374
|
|
Re: a C#program sending a message in Russian
[re: Krasin]
08.09.2006 19:41
|
|
|
Well, then s/he has to STFM. Keywords: locale, native language support, internalization, multilinguization &c.
--- Q22: and what does not suck then? A22: Microsoft vacuum-cleaner.
|
|
Krasin
|
|
|
|
|
Рег.: 23.06.2004
|
Сообщений: 7039
|
Из: Калифорния
|
Рейтинг: 3386
|
|
Re: a C#program sending a message in Russian
[re: KOHTPA]
08.09.2006 19:46
|
|
|
Keywords: KONTPA, lamer
.net строки хранит в unicode и преобразует к указанной кодировке текст сам. Проблема у чувака скорее всего в том, что utf-8 режется тем же 172.16.39.1
|
|
sokol
|
ясный
|
|
|
|
Рег.: 08.11.2002
|
Сообщений: 39240
|
|
Рейтинг: 12313
|
|
Re: a C#program sending a message in Russian
[re: Krasin]
08.09.2006 19:49
|
|
|
В ответ на:
Keywords: KONTPA, lamer
+1
|
|
KOHTPA
|
Carpal Tunnel
|
|
|
|
Рег.: 22.01.2003
|
Сообщений: 33647
|
|
Рейтинг: 2374
|
|
Re: a C#program sending a message in Russian
[re: Krasin]
08.09.2006 19:54
|
|
|
> KONTPA
Да уж, действительно ламер.
> Проблема у чувака скорее всего в том, что utf-8 режется тем же 172.16.39.1
.Net не знает про base64?
--- ...Я работаю антинаучным аферистом...
|
|
hml
|
journeyman
|
|
|
|
Рег.: 15.09.2005
|
Сообщений: 69
|
|
Рейтинг: 0
|
|
Re: a C#program sending a message in Russian
[re: Krasin]
08.09.2006 19:55
|
|
|
Quote:
SmtpClient client = new SmtpClient("smtp.mail.ru"); client.Credentials = new NetworkCredential("myaccount", "mypassword"); MailMessage mes = new MailMessage( new MailAddress("myaccount@mail.ru"), new MailAddress("destination@mail.ru")); mes.Subject = "TEST"; mes.Body = "ав"; mes.BodyEncoding = System.Text.Encoding.UTF8; client.Send(mes);
i use Vs.net 2003
|
|
Krasin
|
|
|
|
|
Рег.: 23.06.2004
|
Сообщений: 7039
|
Из: Калифорния
|
Рейтинг: 3386
|
|
Re: a C#program sending a message in Russian
[re: hml]
08.09.2006 19:57
|
|
|
В ответ на:
i use Vs.net 2003
Why? Тем не менее, try to change smpt server and send a message via smtp.mail.ru.
|
|
hml
|
journeyman
|
|
|
|
Рег.: 15.09.2005
|
Сообщений: 69
|
|
Рейтинг: 0
|
|
Re: a C#program sending a message in Russian
[re: Krasin]
08.09.2006 19:59
|
|
|
the ip is ip of server.hackers . it works properly.
|
|
hml
|
journeyman
|
|
|
|
Рег.: 15.09.2005
|
Сообщений: 69
|
|
Рейтинг: 0
|
|
Re: a C#program sending a message in Russian
[re: hml]
08.09.2006 20:00
|
|
|
.net 2.0 means that visual studio 2005.
|
|
Krasin
|
|
|
|
|
Рег.: 23.06.2004
|
Сообщений: 7039
|
Из: Калифорния
|
Рейтинг: 3386
|
|
Re: a C#program sending a message in Russian
[re: hml]
08.09.2006 20:06
|
|
|
Ага. И в чем проблема использовать VS 2005?
|
|