```ruby
class ErrorMailer < ApplicationMailer
  def error_email(user, error_info)
    @user = user
    @error_info = JSON.parse(error_info).with_indifferent_access

    mail(
      to: Rails.application.secrets.error_email,
      subject: @error_info[:exception],
    )
  end
end
```

Set the FROM to the same as the TO for sending error emails Rails apparently requires this in production mode We had hoped to let sendmail set this, but it doesn't look like rails will allow that.
user
```ruby
class ErrorMailer < ApplicationMailer
  def error_email(user, error_info)
    @user = user
    @error_info = JSON.parse(error_info).with_indifferent_access

    mail(
      from: Rails.application.secrets.error_email,
      to: Rails.application.secrets.error_email,
      subject: @error_info[:exception],
    )
  end
end
```
assistant