Tag: 确认电子邮件

通过localhost在ROR应用程序中向注册用户发送确认电子邮件

在我的ROR应用程序中,我正在尝试在注册时向我的注册用户发送确认电子邮件,我的网站目前在localhost上。 我收到此错误: “undefined method `recipients’ for #” 这是我的代码; development.rb config.action_mailer.delivery_method = :smtp config.action_mailer.default_url_options = { :host => “localhost:3000”} config.action_mailer.smtp_settings = { :address => “smtp.gmail.com”, :port => “587”, :authentication => :login, :user_name => “myemailid@gmail.com”, :password => “myrealpassword” } Users_controller.rb def new UserMailer.registration_confirmation(@user).deliver end def create @user = User.new(params[:user]) if @user.save UserMailer.registration_confirmation(@user).deliver sign_in @user flash[:success] = “Welcome!” […]