Skip to content

Instantly share code, notes, and snippets.

@gnufied
Created April 24, 2012 18:51
Show Gist options
  • Save gnufied/2482659 to your computer and use it in GitHub Desktop.
Save gnufied/2482659 to your computer and use it in GitHub Desktop.
require "eventmachine"
require "mailfactory"
mail = MailFactory.new
mail.to = '[email protected]'
mail.from = '[email protected]'
mail.subject = 'hi!'
mail.text = 'hello world'
mail.html = '<h1>hello world</h1>'
binding.pry()
EM.run do
email = EM::P::SmtpClient.send(
:domain=>'site.com',
:from=>mail.from,
:host => "localhost",
:port => 1025,
:to=>mail.to,
:content=>"#{mail.to_s}\r\n.\r\n"
)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment