📜  rails 捕获邮件错误 - Ruby 代码示例

📅  最后修改于: 2022-03-11 15:04:48.534000             🧑  作者: Mango

代码示例1
begin
        UserMailer.welcome_email(@user).deliver
        flash[:success] = "#{@user.name} created"
      rescue Net::SMTPAuthenticationError, Net::SMTPServerBusy, Net::SMTPSyntaxError, Net::SMTPFatalError, Net::SMTPUnknownError => e
        flash[:success] = "Utente #{@user.name} creato. Problems sending mail"
      end