Skip to content

iwakura/gmail_sender

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gmail_sender

A simple gem to send email through gmail

require 'rubygems'
require 'gmail_sender'

g = GmailSender.new("gmail_account_user_name", "gmail_account_password")
g.attach('/path/to/document.hz') # you can attach any number of files, but there are limits for total attachments size
g.send("[email protected]", "The subject", "The mail body")

Command line usage

You can also use gmail_sender from the command line. First you need to create ~/.gmail with this content (YAML):

receiver_email: [email protected]
sender_user: gmail_account_user_name
sender_password: gmail_account_password

Is advisable to use a different sender account than your main email address so that it’s not so bad if someone reads your configuration file and gets your password.

Examples

To send your directory list to the default receiver:

ls | gmail

You can specify some parameters like in this example which doesn’t use pipes:

gmail -t [email protected] -s "This is the subject" -c "This is the email content"

Requirements

tlsmail if running Ruby 1.8.6

Major contributors

  • Daniel Cadenas - Maintainer

  • Felipe Coury

About

A simple gem to send email through gmail

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%