I am using TheBat! (and it works successfully) to grab files from a folder, make the file into the attachment, and then send the file by email to the email address in the file name. With the help these:
Sendfile.cmd:
For %%i in ("C:\Documents and Settings\Desktop\BAT\XXX\*.txt") do "C:\Program Files\The Bat!\thebat.exe" /MailT="C:\Documents and Settings\Desktop\BAT\Sendfile.tpl";A="%%i";To="%%i";Send
And a Sendfile.tpl:
%SetPattRegExp='C:\\Documents and Settings\\Desktop\\BAT\XXX\\(.*?)~~(.*?)\.txt'%-
%RegExpBlindMatch='%To'%-
%ModifyOnce(To)%-
%SetHeader(To,%SubPatt='1')%-
%Subject="Hello."
Hi %ABToFirstName="%ToFName",
Thank you.
Regards, %FromFName
And this Sorting Office template:
copy "C:\Documents and Settings\Desktop\BAT\XXX\%Attachments"
"C:\Documents and Settings\brian\Desktop\BAT\Sent"
del "C:\Documents and Settings\Desktop\BAT\XXX\%Attachments"
The file I've named here, as an example, with XXX has to actually be named with unicode characters, but TheBat! won't grab and send unless the folder has an english name. Is there a way to make this work? (besides renaming the folder to a non-unicode name).
thanks.
Sendfile.cmd:
For %%i in ("C:\Documents and Settings\Desktop\BAT\XXX\*.txt") do "C:\Program Files\The Bat!\thebat.exe" /MailT="C:\Documents and Settings\Desktop\BAT\Sendfile.tpl";A="%%i";To="%%i";Send
And a Sendfile.tpl:
%SetPattRegExp='C:\\Documents and Settings\\Desktop\\BAT\XXX\\(.*?)~~(.*?)\.txt'%-
%RegExpBlindMatch='%To'%-
%ModifyOnce(To)%-
%SetHeader(To,%SubPatt='1')%-
%Subject="Hello."
Hi %ABToFirstName="%ToFName",
Thank you.
Regards, %FromFName
And this Sorting Office template:
copy "C:\Documents and Settings\Desktop\BAT\XXX\%Attachments"
"C:\Documents and Settings\brian\Desktop\BAT\Sent"
del "C:\Documents and Settings\Desktop\BAT\XXX\%Attachments"
The file I've named here, as an example, with XXX has to actually be named with unicode characters, but TheBat! won't grab and send unless the folder has an english name. Is there a way to make this work? (besides renaming the folder to a non-unicode name).
thanks.