Email on Rails

Image Source: joeydevilla.com
This is a guide on how to send message from your email using Ruby on Rails. First thing to do is to create a mailer for you to use in your application.
- Open the command prompt window or your terminal
- Run “./script/generate mailer MyMailer” from your Rails application home directory
Then you will have to configure the mailer. To be able to do this you should;
In your text editor, open config/environment.rb
Then add this script in the file’s bottom part
config.action_mailer.delivery_method = :smtp
ActionMailer::Base.server_settings = {
:address => “smtp.example.com”,
:port => 25,
:user_name => “username”,
:password => “password”,
:authentication => :plain
}
写真提供: eclips3media.com