a C#program sending a message in Russian
I suppose message "АВАВфцукцуЭ" not to be Russian.
---
Q22: and what does not suck then?
A22: Microsoft vacuum-cleaner.
why ?
the original problem i want to solve is to read the text file ( in russian) and send it to an email.
message.BodyEncoding = System.Text.Encoding.UTF8;
message.SubjectEncoding = System.Text.Encoding.UTF8;
mes.From = "myisp.net";
mes.To = "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
> 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.
how to convert the string to UTF-8. Please let me know.
You should have converted this string into UTF-8.You do not know .net, . He should not.
SmtpClient client = new SmtpClient("smtp.mail.ru");
client.Credentials = new NetworkCredential("myaccount", "mypassword");
MailMessage mes = new MailMessage(
new MailAddress("mail.ru"
new MailAddress("dmail.ru";
mes.Subject = "TEST";
mes.Body = "ав";
mes.BodyEncoding = System.Text.Encoding.UTF8;
client.Send(mes);
It works fine.
Keywords: locale, native language support, internalization, multilinguization &c.
---
Q22: and what does not suck then?
A22: Microsoft vacuum-cleaner.
.net строки хранит в unicode и преобразует к указанной кодировке текст сам. Проблема у чувака скорее всего в том, что utf-8 режется тем же 172.16.39.1
Keywords: KONTPA, lamer+1
![](/images/graemlins/grin.gif)
Да уж, действительно ламер.
> Проблема у чувака скорее всего в том, что utf-8 режется тем же 172.16.39.1
.Net не знает про base64?
---
...Я работаю антинаучным аферистом...
SmtpClient client = new SmtpClient("smtp.mail.ru");i use Vs.net 2003
client.Credentials = new NetworkCredential("myaccount", "mypassword");
MailMessage mes = new MailMessage(
new MailAddress("mail.ru"
new MailAddress("dmail.ru";
mes.Subject = "TEST";
mes.Body = "ав";
mes.BodyEncoding = System.Text.Encoding.UTF8;
client.Send(mes);
i use Vs.net 2003Why?
Тем не менее, try to change smpt server and send a message via smtp.mail.ru.
the ip is ip of server.hackers . it works properly.
net 2.0 means that visual studio 2005.
Ага. И в чем проблема использовать VS 2005?
the ip is ip of server.hackers . it works properly.Попытайся через него отправить письмо в utf-8 из The Bat или Outlook. Если получится отправить, значит, проблема в коде. Не получится — в сервере.
SmtpClient is not available in .net 2.0
SmtpClient is not available in .net 2.0What makes you think so?
Now I have another problem.
I have a file a.txt. The content of this file is in russian.
авыаываывавыаываыва.
I want to show it in console in russian. But it does not work.
StreamReader f = File.OpenText("a.txt");
System.Console.WriteLine(f.ReadToEnd;
f.Close;
But there is nothing in monitor after running it.
Help me.
![](/images/graemlins/smile.gif)
(cl-smtp:send-email "gw.local" "email1" "email2" "Превед!" "Превед, как дела?")
It worked so well, I was surprised myself. Ditch NET, it's Unicode support is probably FUBAR, so it screws Russian text.
Using C# to send a message is easy to code.
![](/images/graemlins/smile.gif)
---
Q13: wtf XXX YYY?
A13: Че?
Console.WriteLine(File.ReadAllText("lala.txt", Encoding.GetEncoding(1251;
---
Q43: А какое предназначение у винды?
A43: bsod
client.Credentials = new NetworkCredential("myaccount", "mypassword");
MailMessage mes = new MailMessage(
new MailAddress("mail.ru"
new MailAddress("dmail.ru";
mes.Subject = "TEST";
mes.Body = "ав";
mes.BodyEncoding = System.Text.Encoding.UTF8;
client.Send(mes);
it does not work fine
У меня работает. Сделай тестовый проект и дай ссылку на него. Так будет проще всего понять, почему у тебя ничего не работает.
NetworkCredential("myaccount", "mypassword");
Just supply a valid account
![](/images/icons/grin.gif)
Оставить комментарий
stat5257402
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 = "myisp.net";
mes.To = "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 mail.ru receive a empty message, not needed message 'АВАВфцукцуЭ'.
Have anybody met the problem? Help me.