| Author |  | 
      
        | boranin Newbie
 
  
 
 Joined: 29 September 2007
 Location: New Zealand
 Online Status: Offline
 Posts: 32
 | 
          I am geting mhtml:mid:// as part of the inline attachment link after msg.GetHtmlAndSaveRelatedFiles. Apparently, this happens only with emails sent from OE. Do you have any solution for this or am I doing something wrong here?
           | Posted: 15 February 2008 at 6:26am | IP Logged |   |  
           | 
 |  
 Part of the code:
 
 Dim strMailImageServer As String = "Components/MailImageServer.aspx?"
 strBody = msg.GetHtmlAndSaveRelatedFiles(strMailImageServer, _
 VirtualMappingType.Dynamic, MessageFolderBehavior.CreateOnly)
 
 Regards,
 Alex
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Andrew AfterLogic Support
 
  
 
 Joined: 28 April 2006
 Location: United States
 Online Status: Offline
 Posts: 1189
 | 
          Could you please provide us with a sample of such message? Use Support Form for this purpose.
           | Posted: 15 February 2008 at 6:41am | IP Logged |   |  
           | 
 |  
 Best regards,
 Andrew
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | boranin Newbie
 
  
 
 Joined: 29 September 2007
 Location: New Zealand
 Online Status: Offline
 Posts: 32
 | 
          Sorted with the following:
           | Posted: 15 February 2008 at 7:33am | IP Logged |   |  
           | 
 |  Dim objRegex As Regex
 strBody = objRegex.Replace(strBody, """mhtml:mid://[0-9]*/!", "")
 
 Will forward te body to support as well.
 
 Now, my next issue is with imp.DownloadEntireMessage. It marks message as read, regardless of the fact folder is opened imp.ExamineFolder. Message would come unread again in a few minutes time.
 What is the explanation here? I know I am missing something.
 Regards,
 Alex
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Alex AfterLogic Support
 
  
  
 Joined: 19 November 2003
 Online Status: Offline
 Posts: 2207
 | 
          
           | Posted: 15 February 2008 at 8:24am | IP Logged |   |  
           | 
 |  
| Quote: 
 
    
    | 
      
       | Will forward te body to support as well. |  |  |  Looking forward to that, thanks.
 
 
| Quote: 
 
    
    | 
      
       | Now, my next issue is with imp.DownloadEntireMessage. It marks message as read, regardless of the fact folder is opened imp.ExamineFolder. |  |  |  Well, this indicates the server incorrectly implements IMAP protocol in this part. The problem is that common email clients do not use EXAMINE to keep mailbox read-only. Since IMAP protocol is very complex, many mail server vendors implement only its part which is used by common email clients and pay little attention to the rest of the features.
 
 To workaround this, you can use Imap.DownloadEnvelopes(messageIndexSet, indexIsUid, parts, bodyPreviewSize) passing very large number (e.g. 999999999) as bodyPreviewSize value. This will return you entire messages because all emails are less than 999999999 bytes but the server will keep thinking it's returning the message header only and thus won't discard unread status. DO not forget to specify MessagePreview flag in parts parameter.
 
 Regards,
 Alex
 | 
       
        | Back to Top |     | 
       
       
        |  |