小编The*_*ibi的帖子

连接被拒绝 - 连接(2)"localhost"端口25轨道

在我的培训期间,我正在一个网站上工作,我们使用Ruby on Rails.我们需要向用户发送邮件,因此我创建了一个邮件程序.

我试图把SMTP均development.rbenvironment.rb

config.action_mailer.default_url_options = {host: '0.0.0.0:3000'}
config.action_mailer.default charset: 'utf-8'
config.action_mailer.delivery_method = 'smtp'
config.action_mailer.perform_deliveries = true
config.action_mailer.smtp_settings = {
  adress: $SMTP_SERVER,
  port: $PORT,
  from: $MAIL,

  enable_starttls_auto: true
  #authentication: 'login'
}
Run Code Online (Sandbox Code Playgroud)

它告诉我错误来自这个方法第6行

def create
  @user = User.new(user_params)

  respond_to do |format|
    if @user.save
      # Tell the UserMailer to send a welcome Email after save
      UserMailer.welcome_email(@user).deliver_now

      format.html { redirect_to(@user, :notice => 'User was successfully created.') }
      format.json { render :json => @user, :status => :created, :location => @user } …
Run Code Online (Sandbox Code Playgroud)

ruby email ruby-on-rails

12
推荐指数
2
解决办法
2万
查看次数

标签 统计

email ×1

ruby ×1

ruby-on-rails ×1