Results 1 to 8 of 8

Thread: MIME in ASP

  1. #1
    Join Date
    Jan 2004
    Location
    India
    Posts
    31

    Question Unanswered: MIME in ASP

    Hi all

    I am a bit stuck in this problem


    I want to display an email's contents thru an HTML popup. the mails i get in my Application folder are of EML type.

    Previously i linked those directly to d/load on user's machine, but client doesn't want to use Outlook Express. What they want is to get email details
    like FROM ,TO et cetera.

    I have tried to search for MIME decoding on MSDN, dbforums but in vain.

    Thanks
    Yogesh Jangam
    Do not walk behind me, for I may not lead.
    Do not walk ahead of me, for I may not follow.
    Do not walk beside me, either.
    Just leave me alone.

    Yogesh Jangam
    http://yogeshjangam.blogspot.com

  2. #2
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    So you just want to open the conents of the EML into a browser window? Does it have to be formatted nicely, or can you just dump the contents of the EML into the HTML?
    That which does not kill me postpones the inevitable.

  3. #3
    Join Date
    Jan 2004
    Location
    India
    Posts
    31

    Display

    hi

    Quote Originally Posted by Seppuku
    Does it have to be formatted nicely, or can you just dump the contents of the EML into the HTML?
    are clients ever happy with raw display. ;-) yes they want cute, formatted display.

    even if possible show it's attachment.

    i thot of an option 2 is to convert EMl to MSG format but seem to get no where !!!!

    Thanks for the answer
    Do not walk behind me, for I may not lead.
    Do not walk ahead of me, for I may not follow.
    Do not walk beside me, either.
    Just leave me alone.

    Yogesh Jangam
    http://yogeshjangam.blogspot.com

  4. #4
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    Can you attach a sample EML file? I can't find one on my PC.
    That which does not kill me postpones the inevitable.

  5. #5
    Join Date
    Jan 2004
    Location
    India
    Posts
    31

    EML files [2] wioth and without attachments

    Hi

    Pleas find attached in zip 2 eml files
    with and without attachments

    EML001 - Without attachments
    EML002 - With attachments

    Thanks
    Yogesh Jangam.
    Attached Files Attached Files
    Do not walk behind me, for I may not lead.
    Do not walk ahead of me, for I may not follow.
    Do not walk beside me, either.
    Just leave me alone.

    Yogesh Jangam
    http://yogeshjangam.blogspot.com

  6. #6
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    Ok.. it's 11:00PM here, so I'm going to bed, but here's some info that may help you. There is a content type called "message". It has a subtype of "rfc822". If you don't need to format it a specific way, but still need it parsed, try opening a filesystem object, read the file in, and write it to the client in a "message/rfc822" content type. I don't know if this will work, but I can play with it tomorrow.

    Now, if you need to format it to the client's requirements, you'll probably need to parse the EML yourself. Meaning, create a filesystem object, read in line by line and put each line through a test checking for certain string criteria ("From:", "To:", etc). Then store the values in variables and display them where you want them to. The tricky part will be attachments. You'll need to create a separate ASP that just parses the EML, pulls the content type and name of the attachment and then sends just the data in that content type you pull. Then on your original page, you have a link to the attachment that points to your new ASP page, passing two parameters (the EML filename, and which attachment - if there are more than one). Clicking that link calls to the second ASP which parses the EML, pulls out the attachment and sends it to the client in the format the attachment is coded in.

    It'd take some work, but it seems feasible.
    That which does not kill me postpones the inevitable.

  7. #7
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    BTW: here is a link on the message/rfc822 content type

    http://www.freesoft.org/CIE/RFC/1521/23.htm
    That which does not kill me postpones the inevitable.

  8. #8
    Join Date
    Jan 2004
    Location
    India
    Posts
    31

    Eureka!!

    Thanks for ur help

    I have sorted that problem out [temporarily of course]

    I am able to display EML file's contents using

    Code:
    Response.AddHeader("Content-Type", "message/rfc822")				
    Response.AddHeader("Content-Disposition", "filename=" & ActFileName )
    It doesn't show attachments but for now it is acceptable.
    Do not walk behind me, for I may not lead.
    Do not walk ahead of me, for I may not follow.
    Do not walk beside me, either.
    Just leave me alone.

    Yogesh Jangam
    http://yogeshjangam.blogspot.com

Posting Permissions

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