mailsystem.NETライブラリを使用して、受信トレイにメッセージを入れます。これは私のコードです:
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);
Gmailの受信トレイを開くと、このメールが表示されますが、本文に????? ???
は「приветмир」ではなく「приветмир」が含まれています。ラテン文字のみが含まれている場合commomMessage.BodyHtml.Text
は問題ありません。