Skip to content
MAMP PRO Documentation

Disable PHP's mail function

During local development you usually do not want PHP to actually send emails. Disabling the mail() function prevents accidental outgoing mail from your local sites.

  1. Open MAMP PRO.

  2. Go to File › Open Template › PHP (php.ini) › [PHP version].

  3. Add the following line inside the [PHP] section:

    disable_functions = "mail"
  4. Save and close the file.

  5. Restart the servers.

Calls to mail() will now silently fail instead of attempting to send email.


PHP how-to guides