Below is a step-by-step process of how to send mail from a command line for FREE using any version of Windows.
- Download for FREE the utility “Send Mail From Command Line” from www.sendmailfromcommandline.com
- Register your interest in this free utility by giving your name and a valid email address. You will be sent the download link
- Create a folder called C:\SMFCL and unzip the downloaded files to this folder
- You will see a file called smfcl.exe. This is all you need to send mail from command line
- Open a DOS command window and locate C:\SMFCL folder:
- Type configuration settings for your SMTP server which will be saved into an INI file as a ONE-OFF and your password encrypted from prying eyes. See below syntax
- C:\SMFCL>smfcl /w “|<Server address>|<User name>|<Password>|<Port>|<SSL either False or True>|<SPA either False or True>|<Sender email address>|”
- As an example: C:\SMFCL>smfcl /w “|127.0.0.1|jbloggs|pa55w0rd|25|False|False|jbloggs@domain.com|”
- Now send any mail from command line by typing the following:
- C:\SMFCL>smfcl /s “|<Recipient email address>|<Subject>|<Email body>|”
- As an example: C:\SMFCL>smfcl /s “|admin@companyxyz.com|ADMIN ALERT-HARD DISK LOW!|The hard disk capacity has reached critical level. Please attend immediately!|”
- The specified email be sent as defined and an entry written to a log file which will be created automatically under C:\SMFCL\Logs
- If any problem is encountered this too is written to the log file for trouble-shooting
If you wanted to send an attachment with your email, this too is possible with Send Mail From Command Line utility. Below is the syntax for sending attachments:
When using the send switch “/s” add an extra element for the attachment path as follows:
C:\SMFCL>smfcl /s “|<Recipient email address>|<Email Subject>|<Email body>|Full attachment path”
As an example: C:\SMFCL>smfcl /s “|admin@companyxyz.com|Admin Alert – hard disk full!|The hard disk capacity has reached critical level. Please attend immediately!|D:\Logs\mylog.txt”
Trouble-shooting tips
- Make sure your SMTP port 25 is allowed through firewalls and your ISP is not blocking it
- Make sure you type the configuration details accurately and the syntax is correctly followed
- Check the Logs folder for the log created for that day as SMFCL creates a new log file for each day it is used. Rectify any errors shown therein
InfiNET Point Limited