Great UDF! Very nice work...
Having a problem getting delete mail working, constantly getting illegal parameter returned.
Would you be able to tell me what I'm doing wrong?
$MailArray = _OutlookGetMail($oOutlook,$olFolderInbox & "\TTDispatch",False,"","","","","","",True,"",0,False)
If @error > 0 Then MsgBox(4096,"Get Mail Error",@error,600)
_ArrayDisplay($MailArray)
;One unread email returned correctly, no issue...
For $mailitem = 1 to (Ubound($MailArray)-1)
$fromemail = $MailArray[$mailitem][1]
$subject = $MailArray[$mailitem][7]
$receivedtime = $MailArray[$mailitem][5]
ConsoleWrite("Fromname = " & $fromemail & " Subject = " & $subject & " Received Time = " & $receivedtime & @CRLF)
;example of email parameters
;Fromname = /O=EMC/OU=NORTH AMERICA/CN=RECIPIENTS/CN=KASCHP
;Subject = INTRANSIT Re: EMC TriageTrac Dispatch: Barclays Capital SR# 31720334
;Received Time = 20091010013225
$DeleteMessage = _OutlookDeleteMail($oOutlook,$olFolderInbox & "\TTDispatch",$fromemail,$subject,$receivedtime,False,False,"")
If @error > 0 Then MsgBox(4096,"Delete Message Error",@error,600)
Next
I'm consistently getting illegal parameters regardless of what parameters are omitted. Do the (from email,subject or received) parameters require a different format than what is returned by get mail?
Also, are you aware of any issues with intermittent missing of messages using get mail with the unread only option set to true? It seems to be missing some emails intermittently, it does still mark the messages read but doesn't return them in the array. This is why I'd prefer to delete each message processed rather than just marking it read.
Thanks in advance for any advice you can offer.
Tim