Ok i put the whole batchfile here...
i just keep it continously running om my windows machine.
see REM for the remarks.
@echo off
cls
set timeout=10
:_loop
REM call the external popclient program to get messages fro pop3 mailbox
c:\temp\popclient\popclient.exe -configfile c:\temp\popclient\democonfig.xml
REM process all the .txt files downloaded by popclient and call :_readfile for every file
for /f %%A in ('dir /B *.txt') do call :_readfile %%A
echo pause %timeout% sec ....
ping 100.100.100.100 -w 1000 -n %timeout% > nul
REM Back to the start
goto :_loop
::------------------------------------------------------------------------------------
:_readfile
set email=empty
set address=empty
set naam=empty
REM Get email data from the email file and put it in variables
REM in my setup i forward the mail and put em, ad and na in front of the name
REM address and email-adress and put that in the message
type %1 | find "em:" /I > %temp%\temp.txt
echo em:
type %temp%\temp.txt
echo ---
for /f "tokens=2 delims=:" %%a in (%temp%\temp.txt) do (@set email=%%a)
type %1 | find "ad:" /I > %temp%\temp.txt
echo ad:
type %temp%\temp.txt
echo ---
for /f "tokens=2 delims=:" %%a in (%temp%\temp.txt) do (@set address=%%a)
type %1 | find "na:" /I > %temp%\temp.txt
echo na:
type %temp%\temp.txt
echo ---
for /f "tokens=2 delims=:" %%a in (%temp%\temp.txt) do (@set username=%%a)
del %temp%\temp.txt
echo -----------------------------------------------------
echo %date% - %time%
echo file: %1
echo email: %email%
echo address: %address%
echo naam: %username%
pause
REM Put all the data in a logfile
echo ----------------------------------------------------- >> c:\temp\popclient\inbox\log.dat
echo %date% - %time% >> c:\temp\popclient\inbox\log.dat
echo file: %1 >> c:\temp\popclient\inbox\log.dat
echo email: %email% >> c:\temp\popclient\inbox\log.dat
echo address: %address% >> c:\temp\popclient\inbox\log.dat
echo naam: %username% >> c:\temp\popclient\inbox\log.dat
move %1 c:\temp\popclient\inbox\processed\
REM Call the bitcoin daemon and send the money to the adress retrieved fro the mail
"c:\Program Files (x86)\bitcoin\daemon\bitcoind.exe" -rpcpassword=xxxxxxxxxx sendtoaddress %address% 0.001 "0.001 naar %email%" "0.001 naar %email%" >> c:\temp\popclient\inbox\log.dat
echo beste %username% > %temp%\bericht.txt
type c:\temp\popclient\template.txt >> %temp%\bericht.txt
set subject="0.001 bitcoins - met de groeten van bitcoinspot.nl"
REM Send mail to email-adress retrieved from mail
c:\temp\popclient\blat %temp%\bericht.txt -to %email% -f
[email protected] -subject %subject% -server x.x.nl > %temp%\temp.txt
type %temp%\temp.txt >> c:\temp\popclient\inbox\log.dat
del %temp%\bericht.txt
REM End of procedure, return to loop
goto :EOF
::------------------------------------------------------------------------------------