Class: Minbox::Cli::Application
- Inherits:
-
Thor
- Object
- Thor
- Minbox::Cli::Application
- Defined in:
- lib/minbox/cli.rb
Instance Method Summary collapse
- #send(host = 'localhost', port = 25) ⇒ Object
- #server(host = 'localhost', port = '25') ⇒ Object
- #version ⇒ Object
Instance Method Details
#send(host = 'localhost', port = 25) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/minbox/cli.rb', line 20 def send(host = 'localhost', port = 25) Net::SMTP.start(host, port) do |smtp| smtp.debug_output = Minbox.logger smtp.(create_mail().to_s, [:from], [:to]) end end |
#server(host = 'localhost', port = '25') ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/minbox/cli.rb', line 30 def server(host = 'localhost', port = '25') publisher = Publisher.from([:output]) server = Server.new(host: host, port: port, tls: [:tls]) server.listen! do |mail| publisher.publish(mail) end end |