Jim Lawless' Blog


Send GMail From the Windows Command-Line with MailWrench

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.

stumbleupon Save to StumbleUpon
digg Digg it
reddit Save to Reddit
facebook Share on Facebook
twitter Share on Twitter
aolfav More bookmarks


Previous post: Converting Data to XML with AWK
Next post:My Journey Began with BASIC


About Jim ...


Subscribe to this blog!



Subscribe via e-mail


Click **here**
to try out MailWrench;
a command-line SMTP /
SMTPS (Google Gmail)
mailer for Windows.


Follow me on Twitter

http://twitter.com/lawlessGuy


Recent Posts

A Forthcoming Marvel Movie Villain

Uninstalling Problematic Windows Software

Don't be Hatin'

A JavaScript REPL for Android Devices

MailSend is Free

My Blog Engine

The October 10th Bug

A Review of Kevin Mitnick's Book Ghost in the Wires


Random Posts

Obfuscated Ruby

BPL: Batch Programming Language Interpreter

A Quine in Forth

Obfuscated C

A GUI for urlx

Choose your own Adventure with Sinatra

My Journey Began with BASIC

Setting Windows Console Text Colors in C

Switching a Console Window to Full Screen or Windowed Mode

The October 10th Bug


Full List of Posts

http://www.mailsend-online.com/bloglist.htm


Recent Posts from my Other Blog

Remembering Dr. San Guinary

Why Some Web Sites will go Dark on Jan 18th

SNL Superhero Skit

More Ruby Games

My Ruby Game Challenge Entry

Steal this Bookmarklet

Nerd Toys

Learn New Jargon, You Must

Spot the Wiebe

Tech Magazine Glory Days

Book Review : Paull Allen - Idea Man

A 90's Experiment in Online Systems - The U.S. West CommunityLink Service