Convert MIME format to text format

Hi,

We have a requirement to convert about 20000 plus *.eml files (MIME format) to emails and Forward to a specific Hardcoded address.

So our requirement is basically to write a script using Lotus script which opens these “eml” files one by one using and forwards to a specific fixed email Address to “abc@abc.com”.

But when I try to open the *.eml file and send it to the id, the body of email is in MIME format but we require it in plain text format.

I can understand I need to convert it into text format programatically adn send it which I am not able to do it as of now.

Require your help here.

Code:

Dim session As NotesSession

Dim db As NotesDatabase

Dim docMemo As NotesDocument

Dim rtitem As NotesRichTextItem

Dim object As NotesEmbeddedObject

Dim Folderpath As String

Dim Path As String

Dim filepath As Variant



Set session = New NotesSession

Set db = session.Currentdatabase



Dim fileNum As Integer

Dim fileName As String

Dim Text As String



Folderpath = "C:\TestFiles\"

filepath = Dir$(Folderpath,0)

Path = Folderpath + filepath



While Not filepath = ""

	Print "Reading File ==> " & filepath

	fileNum% = FreeFile()

	Open Path For Input As fileNum%

	Set docMemo = New NotesDocument (db)

	docMemo.Form = "Memo"

	docMemo.Subject = filepath

	Set rtitem = New NotesRichTextItem (docMemo, "Body")

	Do While Not EOF(fileNum%)

		Line Input #fileNum, text$

		Call rtitem.AppendText(text$)

		Call rtitem.AppendText(Chr(13))

	Loop

	docMemo.SendTo = "amb@hoegh.com"

	docMemo.Send (False)

	Close fileNum%

	filepath = Dir$

	Path = Folderpath + filepath

Wend



Print "Emailing .eml/.txt files complete…"

Thanks in advance,

Amit