Hi,
I'm using migrationsample.cs to create a mail in a mailbox using the mail
migration APIs.
I'm experiencing problems with accentued characters in the message that
become unreadable after migration.
I've managed to handle it encoding the message to base64 before send but
the doc says that it's deprecated.
Furthermore, the migrated mail is not using quoted-printable chars like
when I receive a mail from another mail application.
Could you post a sample or explain what is the proper way to manage them?
Below is the current solution.
// RFC 822 email message to migrate.
private const string rfcTxt =
"Received: by 10.143.160.15 with HTTP; Mon, 16 Jul 2007
10:12:26 -0700 (PDT)\r\n" +
"Message-ID: <[email protected]>\r\n" +
"Date: Mon, 16 Jul 2007 10:12:26 -0700\r\n" +
"From: \"Mr. Serious\" <[email protected]>\r\n" +
"To: \"Mr. héhéhéhé\"
<[email protected]>\r\n" +
"Subject: hébé Subject \r\n" +
"MIME-Version: 1.0\r\n" +
"Content-Type: text/plain; charset=utf-8\r\n" +
"Content-Transfer-Encoding: quoted-printable\r\n" +
"Content-Disposition: inline\r\n" +
"Delivered-To: [email protected]\r\n" +
"\r\n" +
"ééé\r\n" +
"\r\n";
static public string EncodeTo64(string toEncode)
{
Encoding enc = new UTF8Encoding(true, true);
byte[] bytes = enc.GetBytes(rfcTxt);
string returnValue = System.Convert.ToBase64String(bytes);
return returnValue;
}
private static string GenerateRandomRfcText()
{
[...]
return EncodeTo64(result);
}
private static MailItemEntry SetupMailItemEntry(string batchId)
{
[...]
entry.Rfc822Msg = new Rfc822MsgElement(GenerateRandomRfcText());
entry.Rfc822Msg.MessageEncoding =
Rfc822MsgElement.EncodingMethod.BASE64;
}
--
You received this message because you are subscribed to the Google Groups
"Google Apps Domain Information and Management APIs" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-apps-mgmt-apis/-/YSAe6xyZtGYJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-apps-mgmt-apis?hl=en.