PrintMail is a wrapper for getmail.exe from
http://www.interlog....charron/getmail.html.
Just add your user information, save the file as
PrintMail.ahk in a folder, download and place
getmail.exe beside it, and it will extract and print the attachments, and move the files to the Printed folder.
Download and install
AutoHotkey to run the script.
Skrommel
23.07.2017: Added option to set target printer
;PrintMail.ahk
; Print mail attachments, uses getmail.exe from http://www.interlog.com/~tcharron/getmail.html
;Skrommel @ 2017
target=Printed
popserver=
port=110
username=
password=
pause=60
deletefromserver=0
printer=
#NoEnv
#SingleInstance,Force
SetWorkingDir,%A_ScriptDir%
If deletefromserver=1
delete=-delete
If printer<>
printer=/d "%printer%
FileCreateDir,%target%
Loop
{
RunWait,cmd /c getmail.exe -u %username% -pw %password% -s %popserver% -port %port% %delete% -xtract,,Hide
FileMove,MSG*.txt,%target%
Loop,*.*
{
If A_LoopFileName In PrintMail.ahk,PrintMail.exe,getmail.exe
Continue
RunWait,print %printer% "%A_LoopFileName%"
FileMove,%A_LoopFileName%,%target%
}
Sleep,% 1000*pause
}