CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2002
    Posts
    26

    MHT and e-mail attachments

    How to find a difference between Attachments and embedded images in the e-mail represented as MHT document?

    Thank you in advance,
    a_k_
    Last edited by a_k_; July 14th, 2007 at 02:27 PM.

  2. #2
    Join Date
    Nov 2004
    Location
    LA. California Raiders #1 AKA: Gangsta Yoda™
    Posts
    616

    Re: MHT and e-mail attachments

    Perhaps a bit more info is needed.

    Is this a email that is sent directly from IE or is it sent from Word?
    Wouldnt the MHT document only contain embedded images as that is the default action of the save as mht type?
    VB/Office Guru™ (AKA: Gangsta Yoda™)
    VB Forums - Super Moderator 2001-Present

    Microsoft MVP 2006-2011

    Please use [code]your code goes in here[/code] tags when posting code.

    Senior Software Engineer MCP, BSEE, CET
    VS 2012 Premium, VS 6.0 Enterprise SP6, VSTO, Office Ultimate 2010, Windows 7 Ultimate
    Star Wars Gangsta Rap SE Reputations & Rating Posts Office Primary Interop AssembliesAdvanced VB/Office Guru™ Word SpellChecker™.NETAdvanced VB/Office Guru™ Word SpellChecker™ VB6Outlook Global Address ListVB6/Crystal Report Ex.VB6/CR Print Setup Dialog Ex.

  3. #3
    Join Date
    Sep 2002
    Posts
    26

    Re: MHT and e-mail attachments

    Thank you for your replay.

    << Is this a email that is sent directly from IE or is it sent from Word?
    in both cases

    << Wouldnt the MHT document only contain embedded images as that is the << default action of the save as mht type?
    The embedded images (that should appear as part of the e-mail body) and attachments (attached documents that should not be presented in the e-mail body) are embedded in the e-mail MHT stream. The embedded images may be linked to the e-mail body different ways. Both types in the most cases have "name" and filename" attributes in the MHT (RFC822). How to determine which ones are attachments?

    Thank you,
    a_k_

  4. #4
    Join Date
    Nov 2004
    Location
    LA. California Raiders #1 AKA: Gangsta Yoda™
    Posts
    616

    Re: MHT and e-mail attachments

    If an image is embedded in the body of an email it will have a "cid:" tag in the src property of the img html tag.

    Code:
    <IMG alt="" hspace=0 
    src="cid:062138107@12072007-31E7" align=baseline 
    border=0>
    VB/Office Guru™ (AKA: Gangsta Yoda™)
    VB Forums - Super Moderator 2001-Present

    Microsoft MVP 2006-2011

    Please use [code]your code goes in here[/code] tags when posting code.

    Senior Software Engineer MCP, BSEE, CET
    VS 2012 Premium, VS 6.0 Enterprise SP6, VSTO, Office Ultimate 2010, Windows 7 Ultimate
    Star Wars Gangsta Rap SE Reputations & Rating Posts Office Primary Interop AssembliesAdvanced VB/Office Guru™ Word SpellChecker™.NETAdvanced VB/Office Guru™ Word SpellChecker™ VB6Outlook Global Address ListVB6/Crystal Report Ex.VB6/CR Print Setup Dialog Ex.

  5. #5
    Join Date
    Sep 2002
    Posts
    26

    Re: MHT and e-mail attachments

    Unfortunately not all the embedded images have cid tags. According to the RFC 2557 ("MIME Encapsulation of Aggregate Documents, such as HTML (MHTML)") the reference can also be defined by "Content-Location".
    So attachment should not have "Content-ID" and "Content-Location"?
    Or it may have "Content-ID" and/or "Content-Location" but not referenced in the body?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured