Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

rails catch mail error

      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
 
PREVIOUS NEXT
Tagged: #rails #catch #mail #error
ADD COMMENT
Topic
Name
9+2 =