Forum: Ruby on Rails Action mailer Problem

C92d95af75a4c4116cdbd904c915d0f1?d=identicon&s=25 sssagar (Guest)
on 2011-04-12 00:12
(Received via mailing list)
Hello,

  This is my users controller create method.

 def create
     @user = User.new(params[:user])
     if @user.save
  UserMailer.welcome_email(@user).deliver
        flash[:success] = "Please check your mail to activate your
account"
        redirect_to root_path
     else
        @title = "Sign up"
        render 'new'
     end

  end

but it is not sending any mail when i create a new user. but it is
creating flash message.

If i use UserMailer.welcome_email(@user).deliver in rails console it
is working fine.

am i missing anything ?? I am using gmail SMTP.

Please help me out.

Thanks,
Sagar
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.