Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got some backup jobs running weekly and would like to have the log files sent to me automatically via email so I don't have to manually check them.

On a Windows system, is there a tool that I can use that will allow me to send an email via Gmail SMTP from a command prompt?

share|improve this question
up vote 7 down vote accepted

Gmail can be used for sending mail by any mail program and from any network.

Some command-line mail products for Windows are:

SendEmail
mailsend
(I have no first-hand experience with these products.)

See also this article : How to use Gmail as your SMTP server.

share|improve this answer

Blat:

What is Blat?
Blat is a Win32 command line utility that sends eMail using SMTP or post to usenet using NNTP.

share|improve this answer

HowToGeek demonstrates a Windows PowerShell script that works very well at How To Send Email From the Command Line in Windows Without Extra Software

Here is the method: First you're defining the variables:

$EmailFrom = “yourMail@gmail.com”
$EmailTo = “theRecipient'sAddress@someServer.com”
$Subject = “your subject”
$Body = “some text”
$SMTPServer = “smtp.gmail.com”
$SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer, 587)
$SMTPClient.EnableSsl = $true
$SMTPClient.Credentials = New-Object System.Net.NetworkCredential(“yourGmailUsername”, “password”);

Then, you're using this command to send the mail:

$SMTPClient.Send($EmailFrom, $EmailTo, $Subject, $Body)

You'll need a valid Gmail account in order to authenticate as a Gmail user.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .