Class: Ezframe::Email

Inherits:
Object show all
Defined in:
lib/ezframe/email.rb

Class Method Summary collapse

Class Method Details

.receiveObject



6
7
8
# File 'lib/ezframe/email.rb', line 6

def receive

end

.send(data) ⇒ Object



23
24
25
26
27
28
29
30
31
# File 'lib/ezframe/email.rb', line 23

def send(data)
  mail = Mail.new do
    from     data[:mail_from]
    to       data[:mail_to]
    subject  data[:subject]
    body     data[:body]
  end
  mail.deliver! 
end

.setup_smtp(options) ⇒ Object

options =

:address              => "smtp.server.host",
:port                 => 1025,
:user_name            => login user,
:password             => login password,
:authentication       => 'plain',
:ssl => true,


17
18
19
20
21
# File 'lib/ezframe/email.rb', line 17

def setup_smtp(options)
  Mail.defaults do
    delivery_method :smtp, options
  end
end