Pages: 1
RSS
Help with extracting Email with Sendfile.tpl
 
On theBat! forum I asked previously if theBat! could automatically extract an email address from a file name, and send the file to that address, if the file name was email@emailaddress.com.txt.

I was kindly provided 2 files, sendfile.cmd and sendfile.tpl (shown below) and they worked successfully on my PC desktop. Thank you.

Now I have installed theBat! on a Windows 2003 server and can send emails fine manually. But I have yet to be successful at "automatically extracting an email address from a file name, and send the file to that address, with the 2 files: sendfile.cmd and sendfile.tpl."

I believe I have re-created on the server, the same thing I have working on my PC. But I've changed the paths in the 2 files to match the path in the server. I've scheduled theBat! to start the program:
C:\Documents and Settings\BAT\Sendfile.cmd

I can see the file being activated, but it doesn't work. There is no outgoing or sent mail.

What am I forgetting? What am I missing? What should I look at? Any suggestions would be GREATLY, greatly appreciated.

Sendfile.cmd
For %%i in ("C:\Documents and Settings\TA*.txt") do "C:\Program Files\The Bat!\thebat.exe" /MailT="C:\Documents and Settings\BAT\Sendfile.tpl";A="%%i";To="%%i";S="%%i";Send

Sendfile.tpl
%SetPattRegExp='C:\\Documents and Settings\\BAT\\TA\\(.*?)~~(.*?)\.txt'%-
%RegExpBlindMatch='%To'%-
%ModifyOnce(To)%-
%SetHeader(To,%SubPatt='1')%-
Hi %ABToFirstName="%ToFName",


 
My guess is that you didn't adjust the path in:
For %%i in ("C:\Documents and Settings\TA*.txt") do
__________________________________
I'm just a user of The Bat! I don't work for Ritlabs.
 
Thank you for your assistance.

I have resolved this issue.
I had orginally copied the files to the server and changed the paths. And it did not run.

So, I created the files new and typed in the parameters (instead of copied) and it works.

I have one other issue which I will create a new post for.

Thanks for your assistance and consideration.

Pages: 1