vendredi 8 février 2019

SMTP not working in production mode rails

I am having trouble sending email from rails app in production mode. This same settings works fine in development mode but in production it used to give me EOF error now its saying "no implicit conversion of Symbol into Integer " in userscontroller line 5. I dont have that problem either when run in dev mode. I have already tried using :sendmail still doesnt work.

class UsersController < ApplicationController
  def create
    user = User.new(user_params)
    redirect_to root_path
    if ContactMeMailer.contact(user.name, user.email, user.message).deliver_now
      flash[:success] = 'Sent Successfully!!'
    else
      flash[:failed] = 'Try Again'
      render :create
    end
  end

  private
  def user_params
    params.require(:user).permit(:name, :email, :message)
  end
end

this is the settings i have in production.rb

this is production rb too.

Aucun commentaire:

Enregistrer un commentaire