I played with email for a bit, heres a section of code
Code:
CheckMail:
Run, "getmail.exe" -u %UserName% -pw %password% -s %server% -delete,,Hide
WinWaitClose, getmail.exe
Sleep, 1000 ; allow time for txt files to get written to hd before proceeding, inc/dec as required..
Loop, *.txt
{
Loop, Read, %A_LoopFileName%
{
If A_LoopReadLine Contains Subject:
Subject = %A_LoopReadLine%
If A_LoopReadLine Contains Date:
Date = %A_LoopReadLine%
etc (lots more code follows, but specific to my useage..)
So, a fileread loop would work. Getmail puts the emails as MSGxxx.txt so the first loop reads all the emails one at a time, the inner loop reads each email contents one line at a time. I dont quite recall, but I think Getmail overwrites the MSG001.txt etc files on each run.. so you should move/etc the emails each run.
Of course, %username% password and server are read in from an ini file, but you can code them into the line.