If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > MIME in ASP

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-11-04, 06:00
yoja7 yoja7 is offline
Registered User
 
Join Date: Jan 2004
Location: India
Posts: 31
Question 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.*************
Reply With Quote
  #2 (permalink)  
Old 05-11-04, 14:14
Seppuku Seppuku is offline
Useless...
 
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.
Reply With Quote
  #3 (permalink)  
Old 05-13-04, 08:09
yoja7 yoja7 is offline
Registered User
 
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.*************
Reply With Quote
  #4 (permalink)  
Old 05-13-04, 10:48
Seppuku Seppuku is offline
Useless...
 
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.
Reply With Quote
  #5 (permalink)  
Old 05-14-04, 01:13
yoja7 yoja7 is offline
Registered User
 
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
File Type: zip EML.zip (20.2 KB, 29 views)
__________________
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.*************
Reply With Quote
  #6 (permalink)  
Old 05-14-04, 02:14
Seppuku Seppuku is offline
Useless...
 
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.
Reply With Quote
  #7 (permalink)  
Old 05-14-04, 02:28
Seppuku Seppuku is offline
Useless...
 
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.
Reply With Quote
  #8 (permalink)  
Old 05-14-04, 07:27
yoja7 yoja7 is offline
Registered User
 
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.*************
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On