Class

Mailer

Extends:

You’ll need a simple config like this in merb_init.rb if you want to actually send mail:

Merb::Mailer.config = {
  :host=>'smtp.yourserver.com',
  :port=>'25',
  :user=>'user',
  :pass=>'pass',
  :auth=>:plain # :plain, :login, :cram_md5, the default is no auth
}

or

Merb::Mailer.config = {:sendmail_path => '/somewhere/odd'}
Merb::Mailer.delivery_method = :sendmail

You could send mail manually like this (but it’s better to use a MailController instead).

m = Merb::Mailer.new :to => 'foo@bar.com',
                     :from => 'bar@foo.com',
                     :subject => 'Welcome to whatever!',
                     :body => partial(:sometemplate)
m.deliver!
Public Attributes
mail
Public Methods
attach
deliver!
net_smtp :plain, :login, or :cram_md5
new
sendmail
test_send
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.