First of all you will need to create account on the mandrill.com.
After log in, select type of integration: SMTP or API. SMTP will suite you in most of the cases.
Click SMTP, and create you API key.
Then in your development.rb or production.rb file add these lines:
config.action_mailer.smtp_settings = {
:port => '587',
:address => 'smtp.mandrillapp.com',
:user_name => ENV['MANDRILL_USERNAME'],
:password => ENV['MANDRILL_APIKEY'],
:domain => 'domain.com',
:authentication => :plain
}
That's basically all. Now you can send email with Mandrill.
EDIT
Also try to add to your to your environment files these line to perform deliveries and raise delivery errors if any. Also add your default_url_options - in development localhost:3000, in production heroku.com
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
config.action_mailer.default_url_options = { host: "localhost:3000" }
Restart your app before testing
EDIT 2
If you want ActionMailer to send email on submit button click, then you will need to move UserMailer.welcome.deliver
to create action of the respective controller.
def create
if @object.save
UserMailer.welcome.deliver
else
render "new"
end
end