Sha256: 8f1049eb719db0dbfa0d5988dddef35b05b78da80450d97785cec7c28f53268b

Contents?: true

Size: 628 Bytes

Versions: 6

Compression:

Stored size: 628 Bytes

Contents

require 'net/smtp'

module MList
  module EmailServer
    
    class Smtp < Base
      def deliver(tmail)
        destinations = tmail.destinations
        tmail.delete_no_send_fields
        Net::SMTP.start(settings[:address], settings[:port], settings[:domain],
            settings[:user_name], settings[:password], settings[:authentication]) do |smtp|
          smtp.sendmail(tmail.encoded, tmail['sender'], destinations)
        end
      end
      
      def execute
        raise "Mail cannot be received through an SMTP server. Please use the '#{MList::EmailServer::Default.name}' type."
      end
    end
    
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
aiwilliams-mlist-0.1.3 lib/mlist/email_server/smtp.rb
aiwilliams-mlist-0.1.4 lib/mlist/email_server/smtp.rb
aiwilliams-mlist-0.1.5 lib/mlist/email_server/smtp.rb
aiwilliams-mlist-0.1.6 lib/mlist/email_server/smtp.rb
aiwilliams-mlist-0.1.7 lib/mlist/email_server/smtp.rb
aiwilliams-mlist-0.1.8 lib/mlist/email_server/smtp.rb