Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Here is my code:
AddExtender("WWPST34I.DLL") host="mail.domain.com" fromaddr="firstname.lastname@example.org" userid="pospay" password="password" port="" msgnumber="" extractfile="" mailbox="" flags="" kInit(host,fromaddr,userid,password,port) mymail=kGetMail(msgnumber,extractfile,strcat(""),mailbox,flags)I do a few file copies and then execute these lines to delete the messages:
Flags="d" mymail=kGetMail(msgnumber,extractfile,strcat(""),mailbox,flags)Everything looked fine until I tried to use the file. It appears to change the original file. Here are the two files:
If you notice the original file is 13.9 K and the postie file is 11.6 K. Whatever postie does to the file makes it unusable for my purposes. Am I doing something wrong? Is there a parameter that I am missing in my code?
I suspect that the sending PC is a MAC, and Postie, by default write the attahcment in "binary" mode - basically meaning "as send". Macs don't use LF's.
By specifying the "t" option you can request translation of CR to CRLF which is what you seem to want.
dafile="c:\temp\postie.fil" fs=Filesize(dafile) binbuf=BinaryAlloc(fs+2500) str=@lf newstr=@crlf ret = BinaryRead( binbuf, dafile ) num = BinaryReplace( binbuf, str, newstr ,0) Message( "Number of '%str%' strings replaced", num ) BinaryWrite( binbuf, dafile )
Article ID: W14432
Filename: kGetMail Converting File Endings.txt
File Created: 2017:07:28:13:58:35
Last Updated: 2001:08:30:10:52:58