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.
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.