Method: Mail::SMTPConnection#deliver!

Defined in:
lib/mail/network/delivery_methods/smtp_connection.rb

#deliver!(mail) ⇒ Object

Send the message via SMTP. The from and to attributes are optional. If not set, they are retrieve from the Message.



51
52
53
54
55
# File 'lib/mail/network/delivery_methods/smtp_connection.rb', line 51

def deliver!(mail)
  envelope = Mail::SmtpEnvelope.new(mail)
  response = smtp.sendmail(envelope.message, envelope.from, envelope.to)
  settings[:return_response] ? response : self
end