Skip to content

Instantly share code, notes, and snippets.

@D3MZ
Created October 1, 2012 21:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save D3MZ/3814390 to your computer and use it in GitHub Desktop.
Save D3MZ/3814390 to your computer and use it in GitHub Desktop.
mandrill hack.
require 'pp'
require 'HTTParty'
require 'mail'
#JSON broken for Mandrill.
#class Mandrill
# include HTTParty
# base_uri 'mandrillapp.com'
# def initialize(key)
# #@auth = {:email => u, :key => p}
# @auth = {:key => key}
# end
#
# def post
# options = {...}
# self.class.post('/messages/send.json', options)
# end
#
# def info
# options = @auth
# self.class.post('/users/info.json', options)
# end
#end
#
#pp Mandrill.new('8c26b2b1-6d84-4d65-ba28-da0cb53ece20').info
#SMTP Seems to work. Nioce
Mail.defaults do
delivery_method :smtp, {
:port => 587,
:address => "smtp.mandrillapp.com",
:user_name => "chelsey@ven.io",
:password => "8c26b2b1-6d84-4d65-ba28-da0cb53ece20"
}
end
mail = Mail.deliver do
to 'nima@ven.io'
#to 'dem_z@mac.com'
from 'Chelsey Konya <chelsey@ven.io>' # Your from name and email address
subject 'Via Mandrill... Lets see if this works'
#text_part do
# body 'This is Plain text.'
#end
#
#html_part do
# content_type 'text/html; charset=UTF-8'
# body '<em>this is some <strong>HTML</strong></em>'
#end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment