Send emails from the command line with SendSMTP
If your PC is always running, even when you’re not around, then you might want it to alert you about important events. Some backup programs have an email notification feature, for example, which keeps you up-to-date with backup progress.
Alternatively, you could use the free SendSMTP to send emails and files directly from your own scripts, perhaps alerting you when a PC is turned on or off, an application is launched, maybe sending you a daily copy of a text log.
Configuring SendSMTP is easier than some similar programs, thanks to a simple GUI. Double-click SendSMTP.exe and an email dialog appears where you’re able to enter From and To addresses, a subject line, body text and attachment, as well as specifying the usual low-level details (mail server name, port, user name, password and more).
Once you’re able to send messages, clicking "Save Settings as Default" saves your details in an INI file (the password is AES-encrypted, for safety). And with that complete, you can send emails from scripts using commands line this:
Replace [email protected] with your address, [email protected] with wherever you’re sending the message, enter a custom subject line and body text, provide your own list of attachments (or leave them out entirely) and you’re ready to go.
Or, if you need more control, SendSMTP has plenty of additional options. You’re able to specify custom servers, credentials, mail agent and HELO names, CC and BCC addresses, and more. Entering SendSMTP /? displays the full list of commands.
Overall, SendSMTP is a powerful email automation tool with a stack of features, but its GUI is the real highlight. Its ability to save your core settings means you don’t have to master lots of cryptic command line switches, and can instead be using the program in just a few minutes.