If you’re looking for a way to send TLS/SSL Mail from a WIndows device, perhaps from Azure or just from the Task Scheduler of your own machine then CMail is something to consider. You probably want some monitoring or other checks send over on a daily basis, or perhaps you just need an Command Line mail tool with TLS/SSL options.
CMail is a perfect command line tool for sending e-mail with TLS/SSL from Windows systems, primarily intended for sending e-mail from batch files or other scripts.

You can set up CMail in a very quick and easy way. You only have to download the executable from the CMail Website.
The most basic command of CMail and something we will be using is:
.\cmail.exe -host:<Mailadress>:'<Secretkey>’@smtp.office365.com:587 -from:<Mailaddress> -to:<Mailaddress> -subject:'<Subject>’
“Be aware of the brackets for the SecretKey.“
You can add a lot content to the message or use your own variables in a script like fashion. The ones you will be likely using are:
-host:[user:pass@]host[:port]
-from:address[:alias]
-to:address[:alias[:DSN]] | @file
-subject:subject text or -body-html:file
-a:file
The SecretKey can be made through the command “-encryptpass:password“. The output is an encrypted version of the specified password and can be used with the -host option so you don’t have a clear password in your script.
If you need more information or command to use with your CMail commands they are perfectly explained at:
https://www.inveigle.net/cmail/usage
If you liked this post, learned some new things or this article helped you out please think about giving a one time donation at the Donation Page to keep the site online!
Leave a comment