Prerequisites
To get the most out of this guide, you’ll need to:1. Setup your environment
Add these lines of code into your environment config file.config/environments/environment.rb
2. Send email using Rails Action Mailer
Then create aUserMailer
class definition.
app/mailers/user_mailer.rb
app/views/user_mailer/welcome_email.html.erb
UserMailer
class. This should return a UserMailer
instance.
deliver_now!
method:
3. Try it yourself
Rails SMTP Example
See the full source code.