here is a quick draft of a VBScript
This will logon to a mailbox (it will prompt for a profile)
It will ONLY look for UNREAD emails
It will then export the FULL body into a text file (name and folder are constants in top of script).
It will probably need some cleaning up to get just the email address but I don't know the format of the email you're receiving so this is your rough draft.
Code:
Dim objSess, objInbox, objMsgColl, objMsgFilter
Dim objMess ' individual message processed in loop
Dim objFile
Dim objFSO
Dim sBodyString
Const DEFAULT_DIR = "C:\"
Const DEFAULT_FILENAME = "Filename.txt"
Set objSess = CreateObject ( "MAPI.Session" )
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.CreateTextFile(DEFAULT_DIR & DEFAULT_FILENAME, True)
objSess.Logon ' assume valid session for this example
Set objInbox = objSess.Inbox
If objInbox Is Nothing Then
MsgBox "Invalid IPM Inbox from session"
'Exit Function
End If
Set objMsgColl = objInbox.Messages ' get Inbox’s messages collection
' ( ... then validate the messages collection before proceeding ... )
Set objMsgFilter = objMsgColl.Filter
' ( ... then validate the message filter before proceeding ... )
objMsgFilter.Unread = True ' filter for unread messages
sBodyString = ""
' Message filter is now specified; ready for display loop
For Each objMess in objMsgColl ' performs loop, Sets each objMess
sBodyString = sBodyString & objMess.Text & ";"
Next
objFile.WriteLine sBodyString
objSess.LogOff
WScript.Echo "Completed"
Set objInbox = Nothing
Set objMsgColl = Nothing
Set objMsgFilter = Nothing
Set objSess = Nothing
Set objFSO = Nothing
Set objFile = Nothing
Let me know how it goes!