title: Problem with chaset encoding using ORACLE utl_smtp
body: <p>I'm working with Oracle 12.2.0.1.0.
  We have created a procedure that sends email with UTL_SMTP package.
  Evrything works fine but we lost encoding specific for polish language.</p>
  <p>NLS settings:
  NLS_CHARACTERSET = EE8MSWIN1250;
  NLS_NCHAR_CHARACTERSET = AL16UTF16;</p>
  <p>We keep msg text in CLOB column in table.</p>
  <pre><code>...
  mime_type  IN VARCHAR2  DEFAULT 'text/plain',
  message IN CLOB,
  ...
  conn utl_smtp.connection;
  ...
      conn := utl_smtp.open_connection(mail_host, mail_port);
      utl_smtp.helo(conn, mail_host);
  ...
      utl_smtp.mail(conn, get_address(my_sender));
      utl_smtp.rcpt(conn, get_address(my_recipients));
  
      utl_smtp.open_data(conn);
      write_mime_header(conn, 'From', sender);
      write_mime_header(conn, 'To', recipients);
      write_mime_header(conn, 'Subject', subject);
      write_mime_header(conn, 'Content-Type', mime_type);
  ...
      loop
         exit when offset &gt; dbms_lob.getlength(message);
         utl_smtp.write_data(conn, dbms_lob.substr( message, 255, offset ));
         offset := offset + 255;
      end loop;
  ...
      utl_smtp.close_data(conn);
      utl_smtp.quit(conn);
  ...
  </code></pre>
  <p>Code for write_mime_header</p>
  <pre><code>  PROCEDURE write_mime_header(conn  IN OUT NOCOPY utl_smtp.connection,
                    name  IN VARCHAR2,
                    value IN VARCHAR2) IS
    BEGIN
      utl_smtp.write_data(conn, name || ': ' || value || utl_tcp.CRLF);
    END;
    
  </code></pre>
  <p>Unfortunately we lose the char encoding. ex. &quot;użytkownik&quot; in clob &quot;uzytkownik&quot; in mail.</p>
  <p>I tried to set the charset in content-type but we still have a problem.</p>
  <pre><code>    write_mime_header(conn, 'Content-Type','text/plain; charset=&quot;UTF8&quot;');
      utl_smtp.write_data(conn, 'Content-Type: text/plain; charset=&quot;EE8MSWIN1250&quot;' || utl_tcp.CRLF); 
  </code></pre>
  <p>How to set the encoding of mail?</p>