Each line that is not an eMail address starts with a ; character (explained on line 1)
Line 1 is an example of using the FOR command, broken up it looks like this;
is the Character used to tell the FOR command to ignore this line
is the Character used to tell the batch file not to display the FOR processes
The first part of the FOR/IN/DO command.
is the parm to the FOR command that says read one line of the file, and put that line in the Var
is how we tell the FOR command to ignore particular lines.
tells the FOR command to put the whole line in the Var
This is the Var the lines get stuffed in.
The second part of the FOR/IN/DO command.
is batch speek for the current file.
The third part of the FOR/IN/DO command.
the Blat command!
Line 2 is a comment (using :: as the comment character) showing how to just echo the Blat command to the screen, and not send the message.
Line 3 tells the batch file to stop processing.
Line 5 through 7 are the eMail addresses to send the message to.
Line 8 & 9 are in the of.txt file referenced in the Blat command with the -of switch.
|Here is the ExampleFOR.bat file.|
1 2 3 4 5 6 7
; @FOR /F "eol=; tokens=*" %%i IN (%0) DO Blat %0 -to %%i -of of.txt ;::@FOR /F "eol=; tokens=*" %%i IN (%0) DO @echo Blat %0 -to %%i -of of.txt ;@exit ========Now we have a list of eMail addresses to send to======== "1st <1st@Blat.tld> \"Hey 1st!,\"" "2nd <2nd@Blat.tld> Hey 2nd!" "3rd <3rd@Blat.tld> Hey 3rd!"
|Here is the of.txt file.|
-s "This is the subject line parm" -attach of.txt