fxe
fxe

Reputation: 575

configure Rails mailer

I have no clue how emails works, what i want is a notification email, to send some sort of email for verification like most forums or webpages do.

I have the following mailer class

class UserMailer < ActionMailer::Base
  default from: "[email protected]"

  def verification_email(user)
    @user = user
    mail( :to => user.email, :subject => "Notification")
  end
end

then i perform UserMailer.verification_email( user).deliver to send the email the problem is i am not receiving any email, the user.email and myemail@gmail have all the correct value on my code, however i am supose i have to configure something in order to send emails from my gmail account with rails ?

Upvotes: 0

Views: 116

Answers (1)

Scott S
Scott S

Reputation: 2746

http://guides.rubyonrails.org/action_mailer_basics.html - See section 5, Action Mailer Configuration. This will show you how to set up ActionMailer to use Gmail as you mail server. That should get you up and running.

Upvotes: 3

Related Questions