/ Published in: Ruby

Simple example for using ActionMailer with Gmail (or other hosts if you remove the TLS settings).
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
require "action_mailer" class Notifier < ActionMailer::Base def email(address) recipients "[email protected]" from "[email protected]" subject "Hello World" body address end end # TLS settings are for gmail, not needed for other mail hosts. Notifier.delivery_method = :smtp Notifier.smtp_settings = { :tls => true, :enable_starttls_auto => true, :address => "smtp.gmail.com", :port => 587, :domain => "yourdomain.com", :password => "12345", :authentication => :plain }
Comments
