Originally published on: Sun, 13 Feb 2011.
Google's GMail service allows e-mail to be sent using an SMTPS ( SMTP over SSL ) interface.
Sending GMail via the Windows command-line requires a command-line mailer with SMTPS support. My commercial MailWrench utility is one such program. ( see: http://www.mailwrench.com ... )
The GMail SMTPS service listens at port 587 on the server smtp.gmail.com. To configure MailWrench to send mail using GMail, create a text file that we'll just name m.cfg and add the following configuration lines:
The MailWrench command-line you would then use to send a simple message would be something like the following:
Note that any of the options specified in the file m.cfg could have been specified on the command-line itself. The ".cfg" files are intended to be used to contain options that rarely change when sending e-mails.
Note that since GMail does not allow arbitrary attachments, any file you attach must be one of the permissible attachment types ( word-processor documents, spreadsheets, images,audio, ...etc. ) Your e-mail may not process properly if you send other file types.
To attach the image file test.png to the above e-mail, add the parameters -a test.png to the above command-line. The new command-line should look like the folllowing:
Command-line text in these examples is Copyright ©2011 by James K. Lawless under the MIT/X11 open-source license so that they can be freely re-used. See http://www.mailsend-online.com/license.php for the full license text. All other text entries are Copyright ©2011 by James K. Lawless.
Views expressed in this blog are those of the author and do not necessary reflect those of the author's employer. Views expressed in the comments are those of the responding individual.

Save to StumbleUpon
Digg it
Save to Reddit
Share on Facebook
Share on Twitter
More bookmarks

Subscribe to this blog!

Click **here**
A Forthcoming Marvel Movie Villain
Uninstalling Problematic Windows Software
A JavaScript REPL for Android Devices
A Review of Kevin Mitnick's Book Ghost in the Wires
BPL: Batch Programming Language Interpreter
Choose your own Adventure with Sinatra
Setting Windows Console Text Colors in C
Switching a Console Window to Full Screen or Windowed Mode
Why Some Web Sites will go Dark on Jan 18th
Book Review : Paull Allen - Idea Man
A 90's Experiment in Online Systems - The U.S. West CommunityLink Service