0

How to save sent mail copy in sent folder that having subject in Greek language.

I have used this code for saving sent mail copy in sent folder.

private static void SendCommandAndReceiveResponse(string command)
{
    try
    {
        if (command != "")
        {
            if (tcpc.Connected)
            {
                dummy = System.Text.Encoding.ASCII.GetBytes(command);
                ssl.Write(dummy, 0, dummy.Length);
             }
             else
             {
                 throw new System.ApplicationException("TCP CONNECTION DISCONNECTED");
             }
         }
         ssl.Flush();
         buffer = new byte[2048];
         bytes = ssl.Read(buffer, 0, 2048);
         sb.Append(System.Text.Encoding.ASCII.GetString(buffer));
         sw.WriteLine(sb.ToString());
         sb = new System.Text.StringBuilder();
    }
    catch (System.Exception ex)
    {
        throw new System.ApplicationException(ex.Message);
    }
}
  • Your code appears to convert the data to ascii, which probably means the greek letter get 'translated' into something else. Have you tried one of the Unicode/UTF7 encodings? – Neil May 07 '20 at 16:00
  • yes, i have tried with utf7 and unicode but it save sent mail subject in ?????? format – Ravi Tiwari May 09 '20 at 16:38
  • How did you check the file? It sounds like you didn't use an editor that understood utf7 or unicode. – Neil May 09 '20 at 19:18
  • I have enter greek subject in text box and trying to send mail, when it makes copy of sent mail in sent folder then subject look like ??????, but recipient mail subject look like original subject. how did i solve this please give me any solution – Ravi Tiwari May 10 '20 at 09:57
  • I have used link for sending mail https://stackoverflow.com/questions/2471218/getting-a-sent-mailmessage-into-the-sent-folder but it was save greek subject in sent folder like ????????? also i have used .SendAndSaveMessageToIMAP() – Ravi Tiwari May 11 '20 at 14:45
  • What editor or method are you using to check the file contents? Notepad? VS? VI? – Neil May 11 '20 at 15:06
  • I have used link for sending mail https://stackoverflow.com/questions/2471218/getting-a-sent-mailmessage-into-the-sent-folder but it was save greek subject in sent folder like ????????? also i have used .SendAndSaveMessageToIMAP() – Ravi Tiwari May 12 '20 at 09:57

0 Answers0