Skip to content

hs/sinatra-send_mail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sinatra-send_mail

sinatra-send_mail is an extension for Sinatra to send e-mail using smtp.

usage:

send_mail(from, to, subject, body, opts)

    from:     sender's address.
    to:       recipient's address.
    subject:  subject of message.
    body:     body of message.
              You can use erb like: erb(:source)
    opts:     options(see below).

  Options:
    content_type: content_type of message.
    extra_header: additional heder.
    account, password, authtype:
                  options for SMTP Authentication.

Example

require 'rubygems'
require 'sinatra'
require 'sinatra/send_mail'

set :smtp_server 'Your SMTP Server'
set :smtp_locale 'Your locale'        # 'ja_JP' or ''

get '/' do
  send_mail('foo@example.com', 'bar@example.com',
            'test', 'Hello!!')
end

Copyright © 2009 Hideki SAKAMOTO. See LICENSE for details.

About

Simple send-mail extention for Sinatra

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages