I recently needed to automate a process of sending emails from MS windows machine, to lots of recipients in order to help a good friend at his work. Think of it as newsletter emails. This is why I made a small .exe file in VB.net . I had little experience with VB.net, this is why I started from the .exe file with GUI which was easier from me to visualize and debug. To cut story short. I made it work. However, without CLI how is it possible to automate it? I know there is autoit program, but ... come on. I 'd spent quite some time to make this work. So I made a CLI version too.
The use is simple.
In the GUI version there are listboxes to add attachments and recipients. Labels are self-explanatory so no need to say much.
The CLI version takes these arguments:
-l=[.txt file path for recipients]
-a=[path of the attachment]
-o=[path of the txt log file to write]
--help for help
e.g. for using gmail
sendmail_cli -u=[email@example.com] -p=[yourpassword] -s=smtp.gmail.com -r=587 -b=newsletter -t=newsletter -l=[absolute path to the txt file with recipients]t -a=[absolute path to attachment] -o=[absolute path to the txt log file]
The messaging is up to minimum, because I know how to work with it and so does my pal. Recipients are added to bcc. You can use any "antivirus / analyzer / anti-malware / sandbox / virtual machine / local mail server" to make sure there is no malicious code there.
Download the sendmail.exe file here and the CLI version here.