diff --git a/app/controllers/admin/application_settings_controller.rb b/app/controllers/admin/application_settings_controller.rb
index b81842e319b29fef815274eeadb44588f874799d..c2bb846482479b9f25e5f7b12c2613c1e68e117a 100644
--- a/app/controllers/admin/application_settings_controller.rb
+++ b/app/controllers/admin/application_settings_controller.rb
@@ -112,6 +112,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
       :koding_enabled,
       :koding_url,
       :email_author_in_body,
+      :html_emails_enabled,
       :repository_checks_enabled,
       :metrics_packet_size,
       :send_user_confirmation_email,
diff --git a/app/views/admin/application_settings/_form.html.haml b/app/views/admin/application_settings/_form.html.haml
index ce803f329f91208d1d6b7a4e142268a699c1c3a3..7accd2529af704279a86cd9aba9e07e24a24d424 100644
--- a/app/views/admin/application_settings/_form.html.haml
+++ b/app/views/admin/application_settings/_form.html.haml
@@ -443,7 +443,16 @@
             Some email servers do not support overriding the email sender name.
             Enable this option to include the name of the author of the issue,
             merge request or comment in the email body instead.
-
+    .form-group
+      .col-sm-offset-2.col-sm-10
+        .checkbox
+          = f.label :html_emails_enabled do
+            = f.check_box :html_emails_enabled
+            Enable HTML emails
+          .help-block
+            By default GitLab sends emails in HTML and plain text formats so mail
+            clients can choose what format to use. Disable this option if you only
+            want to send emails in plain text format.
   %fieldset
     %legend Automatic Git repository housekeeping
     .form-group
diff --git a/changelogs/unreleased/7749-add-setting-to-disable-html-emails.yml b/changelogs/unreleased/7749-add-setting-to-disable-html-emails.yml
new file mode 100644
index 0000000000000000000000000000000000000000..9dd04d3f089a98a41f05108455ea94885542fede
--- /dev/null
+++ b/changelogs/unreleased/7749-add-setting-to-disable-html-emails.yml
@@ -0,0 +1,3 @@
+title: Add setting to enable/disable HTML emails
+merge_request: 7749
+author:
diff --git a/config/initializers/email_template_interceptor.rb b/config/initializers/email_template_interceptor.rb
new file mode 100644
index 0000000000000000000000000000000000000000..f195ca9bcd6a8df109e96d294a1270be85964560
--- /dev/null
+++ b/config/initializers/email_template_interceptor.rb
@@ -0,0 +1,2 @@
+# Interceptor in lib/email_template_interceptor.rb
+ActionMailer::Base.register_interceptor(EmailTemplateInterceptor)
diff --git a/db/migrate/20161128161412_add_html_emails_enabled_to_application_settings.rb b/db/migrate/20161128161412_add_html_emails_enabled_to_application_settings.rb
new file mode 100644
index 0000000000000000000000000000000000000000..1c59241d0feef21aeb87a42dd5bc7ffd1ce2a505
--- /dev/null
+++ b/db/migrate/20161128161412_add_html_emails_enabled_to_application_settings.rb
@@ -0,0 +1,29 @@
+# See http://doc.gitlab.com/ce/development/migration_style_guide.html
+# for more information on how to write migrations for GitLab.
+
+class AddHtmlEmailsEnabledToApplicationSettings < ActiveRecord::Migration
+  include Gitlab::Database::MigrationHelpers
+
+  # Set this constant to true if this migration requires downtime.
+  DOWNTIME = false
+
+  # When a migration requires downtime you **must** uncomment the following
+  # constant and define a short and easy to understand explanation as to why the
+  # migration requires downtime.
+  # DOWNTIME_REASON = ''
+
+  # When using the methods "add_concurrent_index" or "add_column_with_default"
+  # you must disable the use of transactions as these methods can not run in an
+  # existing transaction. When using "add_concurrent_index" make sure that this
+  # method is the _only_ method called in the migration, any other changes
+  # should go in a separate migration. This ensures that upon failure _only_ the
+  # index creation fails and can be retried or reverted easily.
+  #
+  # To disable transactions uncomment the following line and remove these
+  # comments:
+  # disable_ddl_transaction!
+
+  def change
+    add_column :application_settings, :html_emails_enabled, :boolean, default: true
+  end
+end
diff --git a/db/schema.rb b/db/schema.rb
index b3c49b5259705b7b78e92cbd5465e33f99461f0f..3d630a148f02b0701f7b233834adacba01e238c5 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
 #
 # It's strongly recommended that you check this file into your version control system.
 
-ActiveRecord::Schema.define(version: 20161118183841) do
+ActiveRecord::Schema.define(version: 20161128161412) do
 
   # These are extensions that must be enabled in order to support this database
   enable_extension "plpgsql"
@@ -106,6 +106,7 @@ ActiveRecord::Schema.define(version: 20161118183841) do
     t.integer "housekeeping_incremental_repack_period", default: 10, null: false
     t.integer "housekeeping_full_repack_period", default: 50, null: false
     t.integer "housekeeping_gc_period", default: 200, null: false
+    t.boolean "html_emails_enabled", default: true
   end
 
   create_table "audit_events", force: :cascade do |t|
diff --git a/lib/email_template_interceptor.rb b/lib/email_template_interceptor.rb
new file mode 100644
index 0000000000000000000000000000000000000000..fb04a7824b82ef9a6efa180871e0b1d8ebc50aaa
--- /dev/null
+++ b/lib/email_template_interceptor.rb
@@ -0,0 +1,13 @@
+# Read about interceptors in http://guides.rubyonrails.org/action_mailer_basics.html#intercepting-emails
+class EmailTemplateInterceptor
+  include Gitlab::CurrentSettings
+
+  def self.delivering_email(message)
+    # Remove HTML part if HTML emails are disabled.
+    unless current_application_settings.html_emails_enabled
+      message.part.delete_if do |part|
+        part.content_type.try(:start_with?, 'text/html')
+      end
+    end
+  end
+end
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb
index 39ba48f61cb2726e0daabc3f9b48adf7f5138c85..b692142713f98c098a3317ae797a8a2dcc220e18 100644
--- a/spec/mailers/notify_spec.rb
+++ b/spec/mailers/notify_spec.rb
@@ -1172,4 +1172,38 @@ describe Notify do
       is_expected.to have_body_text /#{diff_path}/
     end
   end
+
+  describe 'HTML emails setting' do
+    let(:project) { create(:project) }
+    let(:user) { create(:user) }
+    let(:multipart_mail) { Notify.project_was_moved_email(project.id, user.id, "gitlab/gitlab") }
+
+    context 'when disabled' do
+      it 'only sends the text template' do
+        stub_application_setting(html_emails_enabled: false)
+
+        EmailTemplateInterceptor.delivering_email(multipart_mail)
+
+        expect(multipart_mail).to have_part_with('text/plain')
+        expect(multipart_mail).not_to have_part_with('text/html')
+      end
+    end
+
+    context 'when enabled' do
+      it 'sends a multipart message' do
+        stub_application_setting(html_emails_enabled: true)
+
+        EmailTemplateInterceptor.delivering_email(multipart_mail)
+
+        expect(multipart_mail).to have_part_with('text/plain')
+        expect(multipart_mail).to have_part_with('text/html')
+      end
+    end
+
+    matcher :have_part_with do |expected|
+      match do |actual|
+        actual.body.parts.any? { |part| part.content_type.try(:match, %r(#{expected})) }
+      end
+    end
+  end
 end