Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: kGetMail
I am having no problems sending but have a problem when receiving. The problem relates to the extract file and the fact that it impossible to know where one message stops and the next begins when retrieving all messages and not deleting them from the server. The email message contents simply get appended to whatever has been added in the session (I delete any previously created extract file before making the call to KGetMail). So the header information is returned from the call to KGetMail and I store that in a header file but there is no way to link this to the messages returned to the extract file.
I have been trying to read one message at a time but no error is returned from the call to KGetMail when a non-existant message number is passed to it which makes it difficult to know when to break out of a loop. I could delete the POP3 message after retrieving the message, end the session, copy the header and extract file to another file, delete the original extract and header files and start another session and so on. But this is not desirable.
I want the option to _not_ have to delete the POP3 messages.
Is there anyway that POSTIE could be modified or updated to at least put some sort of marker between messages. I could then parse out the messages.
AddExtender("WWPST34I.DLL") host="mail.yourdomain.com" fromaddr="whoareyou@yourdomain.com" userid="yourid" password="alkdfjlskfhlsd" port="" msgnumber="" extractfile="" mailbox="" flags="" DirChange("D:\Temp") kInit(host,fromaddr,userid,password,port) allmsgs=kGetMail(msgnumber,extractfile,"",mailbox,flags) ;message("",allmsgs) xmsgs=ItemExtract(3,allmsgs," ") xpos=0 For i=1 to xmsgs xpos=StrIndex(allmsgs,"Date:",xpos,@fwdscan) temppos=StrIndex(allmsgs,@CRLF,xpos,@backscan) temppos=StrIndex(allmsgs,@CRLF,temppos,@backscan)+2 ;advance the pointer to just past the current "date" so as to search forward to next date nextdatepos=StrIndex(allmsgs,"Date:",xpos+1,@fwdscan) nextpos=StrIndex(allmsgs,@crlf,nextdatepos,@backscan) nextpos=StrIndex(allmsgs,@crlf,nextpos,@backscan)+2 msgcontent=StrSub(allmsgs,temppos,nextpos-temppos) xpos=nextpos-1 message("",msgcontent) Next
Article ID: W14430
Filename: Grabbing Individual Msgs from kGetMail.txt
File Created: 2001:03:01:15:39:22
Last Updated: 2001:03:01:15:39:22