Method: Email.send_raw_email

Defined in:
lib/email/email.rb

.send_raw_email(from, password, to, mail_text) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/email/email.rb', line 5

def Email.send_raw_email(from, password, to, mail_text)
  smtp = Net::SMTP.new('smtp.gmail.com', 587)
  smtp.enable_starttls
  smtp.start(from.split('@')[-1], from, password, :login) do
    smtp.send_message(mail_text, from, to)
  end
end