[Drupal 6] How to disable the Drupal registration confirmation email?

| | 1 min read

Drupal does not provide the option to disable the confirmation mail that is send to a user after they have successfully completed registration in a Drupal site. However there is way to disable the mail using custom PHP code. If you are facing such a scenario in your Drupal site then read on to know how to disable the Drupal registration email in a Drupal 6 website.

User registration is an important feature on almost all websites on the web today. In the case of a Drupal site, when a user completes the registration process, a mail is sent to them with the relevant details necessary for them to login to the Drupal website along with the confirmation message. Drupal provides us with the options to customize the mail. We can customize this mail by changing the values in user settings page.(admin/user/setting) as shown below.Drupal Registration Confirmation Email
However there is no option to disable the mail during the registration time. But you can depend on your custom PHP code to do this. Follow the steps below to do so.

Steps to follow

  • First write a hook_mail_alter() in one of your custom modules
  • Next set the mail variable as FALSE
    <?php
    function hook_mail_alter(&$message) {
      // sets the user_mail_register_no_approval_required_notify false.
      variable_set('user_mail_register_no_approval_required_notify', false); 
    }
    ?>

If you want to disable the other mail functions, set the corresponding variable as FALSE.