Extracting Attachment from .eml file through VB.net

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to extract all information from .eml file without using outlook
express. I am able to extract all the information except Attachments. Can
somebody please suggest some solution ??
 
* "=?Utf-8?B?VmlrYXMgR3VwdGE=?= said:
I need to extract all information from .eml file without using outlook
express. I am able to extract all the information except Attachments. Can
somebody please suggest some solution ??

Messages are often encoded in MIME format:

<URL:http://www.mhonarc.org/~ehood/MIME/>
 
You can use CDO for Exchange 2000 (CDOEX), load the eml into a CDO.Message
object, then you can access the message attachments directly.

Dim strm As ADODB.Stream
Dim myMail As New CDO.Message
strm = myMail.GetStream()
strm.Type = ADODB.StreamTypeEnum.adTypeText
strm.LoadFromFile("c:\file.eml")
strm.Flush()
Dim attach As IBodyPart
For Each attach In myMail.Attachments
MsgBox(attach.FileName)
Next

Cheers,
John Wadie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top