.NET Components for Mobility

EmailMessage Encoding problem in HTML message

Last post 07-13-2010 5:42 AM by penyaskito. 33 replies.
Page 1 of 3 (34 items) 1 2 3 Next >
Sort Posts: Previous Next
  • 03-05-2010 5:40 AM

    EmailMessage Encoding problem in HTML message

    Hi folks,

    I'm trying to render an HTML formatted EmailMessage in a WebBrowser control, but I've got a problem with encoding.

    If the mail message is "cómo realizar la inscripción", and I add a "watch" to the BodyHTML property I see "c?mo realizar la inscripci?n" (of course, HTML tags are around).

    The encoding of the HTML is ISO-5589-1, that should be fine. If I open this same email message in Pocket Outlook I can read it with any kind of problem.

    Is this a known bug? Are there any workarounds? Thanks in advance

  • 03-06-2010 3:50 PM In reply to

    Re: EmailMessage Encoding problem in HTML message

    I'm currently investigating an issue with encoding in message bodies. Is this occuring on an ActiveSync email account or POP/IMAP?

    Peter

  • 03-06-2010 9:37 PM In reply to

    Re: EmailMessage Encoding problem in HTML message

    Hi Peter,
    I have seen this problem in ActiveSync. Haven't tested with POP/IMAP,
    Hope this helps and thanks for your time.
  • 03-08-2010 5:45 AM In reply to

    Re: EmailMessage Encoding problem in HTML message

    Just tested with IMAP, it works as expected.
  • 03-11-2010 12:24 PM In reply to

    Re: EmailMessage Encoding problem in HTML message

    Hi Pete! Any news on why it doesn't work when using ActiveSync? Thanks!
  • 03-17-2010 12:48 PM In reply to

    Re: EmailMessage Encoding problem in HTML message

    Hi Pete!
    With the latest release, 4.1.0316.0, the problem is getting worse. When I check the EmailMessage BodyHtml property, I get on the Watch Expression panel:
    Could not evaluate expression string
    If I assign it to a WebBrowser component, I get nothing but an empty browser.
    The BodyText and BodyRaw properties return an empty string.
    The problem is only happening on HTML mails with vowels with tildes: áéíóú, not in plain text emails.
    We are being blocked because of this problem, so any help would be much appreciated.
  • 03-17-2010 1:48 PM In reply to

    Re: EmailMessage Encoding problem in HTML message

    Ok, I had a problem with a mail message that was partially downloaded.
    Once the mail message is completely downloaded, the BodyHTML has a wrong encoding, but BodyRaw is fine, so I can use it as a workaround.
    Thanks for your time.
  • 03-17-2010 2:02 PM In reply to

    Re: EmailMessage Encoding problem in HTML message

    Sorry for spaming, btw is funny talking alone knowing that you will answer later today when I'll be sleeping :-P
    This should be definitively a bug. At random times the BodyRaw is empty, or contains the correct HTML with the correct encoding. I'm always looking the same mail, which DownloadState is FullItem.
    I don't know what else could I check, so any hint for fixing this or helping you debugging this will be great.
  • 03-18-2010 2:43 AM In reply to

    Re: EmailMessage Encoding problem in HTML message

    I've had a look and I think I have located an issue with BodyHtml which causes it to return with incorrect encoding. As you have noticed you can access the BodyRaw property to retrieve the full HTML text on a HTML message. I'm working on a fix but the workaround is to use BodyRaw.

    The issue with empty BodyRaw is separate. BodyRaw contains the body contents at the time the EmailMessage object was created (BodyHtml will return the current contents direct from the underlying MAPI message). If you receive a message which is fully downloaded by BodyRaw is empty the first test I would like you to try is to displose the EmailMessage and create a new one - something like this:-

    ItemId id = em.ItemId;

    em.Dispose();

    em = new EmailMessage(id);

    If this works and contains the BodyRaw then it is some kind of timing issue, if the issue persists there is some other issue. Check that the NativeMessageFormat is returned as Html, and that BodyText is also empty. You could check the MimeText property but this should not be used for ActiveSync accounts on Windows Mobile 6.

    Please let me know how you get on and I'll try to help resolve this.

    Regards,

    Peter

     

  • 03-18-2010 4:34 AM In reply to

    Re: EmailMessage Encoding problem in HTML message

    Hi Peter,
    The problem seems to have been fixed disposing the item as you suggested. So it should be the timing issue (btw, I'd like to know if there's some way of waiting for the EmailMessage to complete the download).
    When disposing the email and retrieving again, the DownloadStatus change to FullItem and all properties are right (except for the encoding of the BodyHTML field, BodyRaw is fine).
    Hope that you can fix this with this information and do a new release.
  • 03-19-2010 3:38 AM In reply to

    Re: EmailMessage Encoding problem in HTML message

    Thanks that information is great. I'll let you know when I have a fix ready.

    Peter

  • 03-19-2010 4:32 AM In reply to

    Re: EmailMessage Encoding problem in HTML message

    I've been experiencing again this, when the EmailMessage DownloadStatus is FullItem the problem still happens.
    1. OPERATION: Open the email in my WebBrowser control. DownloadStatus is Partial and it calls RemoteDownload() and MessagingApplication.Synchronize(). Dispose it and retrieve it again.
    RESULT: The correct HTML is displayed. It's not the full item because it's not already downloaded.
    2. OPERATION: Go back. Open again the email, DownloadStatus is FullItem. Dispose it and retrieve it again.
    RESULT: BodyRaw, BodyHTML and BodyText are Empty, and the email cannot be displayed.
  • 03-25-2010 8:23 AM In reply to

    Re: EmailMessage Encoding problem in HTML message

    Hi Peter, how are you?
    Is there any news about this issue? An estimate of when it will be resolved?
    Thanks, have a good day :)
  • 04-13-2010 3:34 AM In reply to

    Re: EmailMessage Encoding problem in HTML message

    I'm being blocked by this problem. Is there any chance to workaround it? Thanks Peter
  • 04-13-2010 6:07 AM In reply to

    Re: EmailMessage Encoding problem in HTML message

    We are currently working on an update. However at the moment you can work around the issue by disposing and re-opening the email and reading the BodyRaw property. e.g.

    ItemId i = em.ItemId;

    em.Dispose();

    em = new EmailMessage(i);

    string bodyHtml = em.BodyRaw;

    You can determine if BodyRaw contains HTML by checking the NativeMessageFormat property.

    Peter

Page 1 of 3 (34 items) 1 2 3 Next >
Copyright © 2001-2012 In The Hand Ltd. All rights reserved. Terms of Use and Privacy Policy. OrcsWeb's Windows Cloud Server Hosting