1. Home
  2. Site Builder
  3. Fixing the “Mail() function returned false” Error in SitePad

Fixing the “Mail() function returned false” Error in SitePad


This article aims to help you with the “Mail() function returned false” error, which can appear on the contact page of your site created with SitePad.

Note : The PlanetHoster Glossary contains explanations on multiple topics and can be consulted to clarify certain terms.


Enter the following address in your web browser : https://mg.n0c.com/en.

Connect to SitePad as explained in Website Creation with the SitePad Site Builder.

Note : Make sure SitePad is configured in English as explained in the article SitePad – How to Change the Language.

Fixing the “Mail() function returned false” error

Sometimes this error is displayed at the bottom of the screen:

If this happens, please follow the instructions below:

  1. Once logged in to SiteBuilder, go to Parameters -> Contact Form:
  1. Enter an email account with the same domain as your hosting in the To and From fields (you will be able to redirect your messages to another address in your N0C panel).
  2. Click on the green Publish button to publish the changes.
  3. Once the changes are published, go to the file manager via the N0C panel and edit the file named “contact.php” :

5. Enter the following two lines as comments in the code :

//$headers .= "Reply-To: " . (!empty($this->replyto) ? $this->replyto : $this->from) . "" . PHP_EOL;
//$headers .= "Return-Path: " . $this->from . "" . PHP_EOL;
  1. Click on the Save and Close buttons.

Note : You will need to do this every time you publish a change with SitePad. Therefore, we  suggest that you keep a backup copy of the contact.php file.

Updated on March 30, 2022

Related Articles