1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Unauthenticated mail via PHP mail()
This guide details sending emails from a website hosted by Infomaniak using the PHP function mail() function, which is disabled by default.
Infomaniak strongly advises against using the PHP mail() function for sending emails from your applications:
- Emails will be considered "unauthenticated" and therefore subject to limits
- Their deliverability will be impacted, which can harm your website
Specify the sending address
To ensure that messages are sent correctly from your CMS/web application (and avoid an error like Could not instantiate mail function
or sender mismatch
), it is necessary to specify a valid address in the site settings on the Infomaniak side:
- Login to the Infomaniak Manager (manager.infomaniak.com) from a web browser like Brave or Firefox
- Click on the icon at the top right of the interface (or navigate through the left side menu, for example)
- Choose Hosting (Web & Domain universe)
- Click directly on the name of the relevant object in the displayed table
- Click on the name of the relevant site (in the Sites section)
- Click on the Advanced Settings button
- Enter an existing email address in the Sender Email field
- Click the blue Save button
Re-enable the mail function
If you still wish to use the PHP mail function, you will need to re-enable it on each of the sites in your Web Hosting account:
- Login to the Infomaniak Manager (manager.infomaniak.com) from a web browser like Brave or Firefox
- Click on the icon at the top right of the interface (or navigate through the left side menu, for example)
- Choose Hosting (Web & Domain universe)
- Click directly on the name of the relevant object in the displayed table
- Click on the name of the relevant site (in the Sites section)
- Click on the Advanced Settings button
- Click on the PHP tab
- Enable the mail function
- Click Save
PHP mail() Example
WordPress
Configure the sending of the default contact form included with Divi Builder:
- Login to the WordPress admin panel
- Go to the Divi editor of the page containing the contact form
- Click on the gear icon to set up the Divi contact form
- Under EMAIL, enter the email address that will receive the form submissions and save
- By default, when a visitor uses the form to contact you, you will receive an email from
mail@your-site-name
, and if you reply, the recipient will automatically be the email address provided by the visitor when filling out the contact form
Joomla
Configure email sending via PHPmail (not recommended) in Joomla:
- Login to your Joomla site's administration panel
- Go to Configuration then Server
- DO NOT enter anything in the Site Email field
Unfortunately, this prevents any sending test via the button for this purpose, but it will work if you set up a contact form on your site. Click Save once the box is left empty.
Reply-to Address for PHP mail()
When sending an email with the PHP mail() function, the return-path
will be in the form root@h2web3.infomaniak.ch
, for example. However, the Reply-To:
header in your form code allows you to specify a valid reply address.