On theBat! forum I asked if theBat! could 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. Thak you.
Now I am hoping I can get some help with theBat! to extract the email address, from a file name, that contains more than just the email address. The files have a name seperated by ~~ followed by the email address and then the extension. Here is an example of a file name:
myLifeStory~~email@emailaddress.com.txt
Can theBat! extract the email address from a file name of this type and place the email address into the TO; line, and send it just as the files below accomplish?
My main question here is: Can the file(s) below be modified to extract only the info that apppears between ~~ and .txt? (and place it in the TO: line? etc.
Thank you. I look forward to your assistance.
Sendfile.cmd
For %%i in ("C :\Documents and Settings\My Documents\Output\*.txt") do "C:\Program Files\The Bat!\thebat.exe" /MailT="C:\Documents and Settings\My Documents\Output\Sendfile.tpl";A="%%i";To="%%i";S=¬"¬%%i";Send
Sendfile.tpl
And a sendfile.tpl, as template. Containing this:
-----Start of Sendfile.tpl-------------¬
%SetPattRegExp='C :\Documents and Settings\My Documents\Output\(.*?)\.txt'%-
%RegExpBlindMatch='%To'%-
%ModifyOnce(To)%-
%SetHeader(To,%SubPatt='1')%-
Hi %ABToFirstName="%ToFName",
I was kindly provided 2 files, sendfile.cmd and sendfile.tpl (shown below) and they worked successfully. Thak you.
Now I am hoping I can get some help with theBat! to extract the email address, from a file name, that contains more than just the email address. The files have a name seperated by ~~ followed by the email address and then the extension. Here is an example of a file name:
myLifeStory~~email@emailaddress.com.txt
Can theBat! extract the email address from a file name of this type and place the email address into the TO; line, and send it just as the files below accomplish?
My main question here is: Can the file(s) below be modified to extract only the info that apppears between ~~ and .txt? (and place it in the TO: line? etc.
Thank you. I look forward to your assistance.
Sendfile.cmd
For %%i in ("C :\Documents and Settings\My Documents\Output\*.txt") do "C:\Program Files\The Bat!\thebat.exe" /MailT="C:\Documents and Settings\My Documents\Output\Sendfile.tpl";A="%%i";To="%%i";S=¬"¬%%i";Send
Sendfile.tpl
And a sendfile.tpl, as template. Containing this:
-----Start of Sendfile.tpl-------------¬
%SetPattRegExp='C :\Documents and Settings\My Documents\Output\(.*?)\.txt'%-
%RegExpBlindMatch='%To'%-
%ModifyOnce(To)%-
%SetHeader(To,%SubPatt='1')%-
Hi %ABToFirstName="%ToFName",