github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

vestel / pony forked from adamwiggins/pony

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 1
    • 28
  • Source
  • Commits
  • Network (28)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (2)
    • bigmerge
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

The express way to send mail from Ruby. — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Revert "Added pony.gemspec" 
vestel (author)
Wed Aug 05 08:06:32 -0700 2009
commit  d1a85d9a193db37ab8262807bd37056ad01e0433
tree    be8be6a76c9bb27dc7be2b55f3a9ef23d37fd3d7
parent  073979404d74b3dfe5a6f41a163d32d34fa83432
pony /
name age
history
message
file README.rdoc Loading commit data...
file Rakefile Mon Mar 16 13:03:42 -0700 2009 v0.3 [adamwiggins]
directory lib/ Wed Aug 05 08:06:32 -0700 2009 Revert "Added pony.gemspec" This reverts commi... [vestel]
file pony.gemspec
directory spec/
README.rdoc

Pony, the express way to send email in Ruby

Overview

Ruby no longer has to be jealous of PHP’s mail() function, which can send an email in a single command.

  Pony.mail(:to => 'you@example.com', :from => 'me@example.com', :subject => 'hi',
            :type => 'html',
            :charset => 'windows-1252',
            :body => 'Hello there.')

Any option key may be omitted except for :to.

Default :type is ‘plain’ for "text/plain", other option is ‘html’ Default :charset is set to ‘utf-8’

Transport

Pony uses /usr/sbin/sendmail to send mail if it is available, otherwise it uses SMTP to localhost.

This can be over-ridden if you specify a via option

  Pony.mail(:to => 'you@example.com', :via => :smtp) # sends via SMTP

  Pony.mail(:to => 'you@example.com', :via => :sendmail) # sends via sendmail

You can also specify options for SMTP:

  Pony.mail(:to => 'you@example.com', :via => :smtp, :smtp => {
    :host   => 'smtp.yourserver.com',
    :port   => '25',
    :user   => 'user',
    :pass   => 'pass',
    :auth   => :plain # :plain, :login, :cram_md5, no auth by default
    :domain => "localhost.localdomain" # the HELO domain provided by the client to the server
  }

TLS/SSL

With smtp transport it also possible to use TLS/SSL:

  Pony.mail(:to => 'you@example.com', :via => :smtp, :smtp => {
    :host   => 'smtp.gmail.com',
    :port   => '587',
    :tls    => true,
    :user   => 'user',
    :pass   => 'pass',
    :auth   => :plain # :plain, :login, :cram_md5, no auth by default
    :domain => "localhost.localdomain" # the HELO domain provided by the client to the server
  })

Attachments

You can attach a file or two with the :attachments option:

  Pony.mail(..., :attachments => {"foo.zip" => File.read("path/to/foo.zip"), "hello.txt" => "hello!"})

Meta

Written by Adam Wiggins

Patches contributed by: Mathieu Martin, Arun Thampi, Thomas Hurst, Stephen Celis, Othmane Benkirane, and Neil Mock

Released under the MIT License: www.opensource.org/licenses/mit-license.php

github.com/adamwiggins/pony

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server