Imap cyrillic mail

Posted by atredis on Stack Overflow See other posts from Stack Overflow or by atredis
Published on 2012-10-18T10:55:53Z Indexed on 2012/10/18 11:00 UTC
Read the original article Hit count: 361

Filed under:
|
|
|
|

I use the mailsystem.NET library to put a message in my inbox. This is my code:

        Imap4Client imap = new Imap4Client();
        imap.ConnectSsl("imap.gmail.com", 993);
        imap.Login(mylogin, mypassword);
        Mailbox mails;
        mails = imap.SelectMailbox("INBOX");
        Message commomMessage = new Message();
        commomMessage.From = new Address("someAddress", "someName");
        commomMessage.To.Add(mylogin, "myName");
        commomMessage.Subject = "someSubject";
        commomMessage.BodyHtml.Text = "?????? ???";//or some cyrillic text 
        commomMessage.Date = DateTime.Now;
        mails.Append(commomMessage);

When I open my gmail inbox, I see this mail, but the body contains ????? ??? rather than "?????? ???". If commomMessage.BodyHtml.Text contains only Latin characters, there is no problem.

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET