Introduction
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 the tool.
Prerequisite
Enter the following address in your web browser : https://mg.n0c.com/en.
Open the interface (how).
Fixing the “Mail() function returned false” error
Sometimes the error “Mail() function returned false” is displayed at the bottom of the screen.
If this happens, please follow the instructions below:
- In the side bar menu, select Settings -> Contact Form.
- 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) and click on the green Publish button to publish the changes:
- Once the changes are published, go to the file manager via the N0C panel and edit the file named “contact.php” (how).
- 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;
- Save the changes.