1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Use unauthenticated (not recommended) email sending from a website
This guide details sending emails from a website hosted by Infomaniak using the PHP function mail() which is disabled by default.
Preamble
- Infomaniak strongly discourages the use of the PHP mail() function for sending emails from your applications:
- Emails will be considered as “unauthenticated” and will therefore be subject to limits.
- Their deliverability will be affected, which can harm your website.
- It is strongly recommended to use an authenticated SMTP sending method for your email sends from your applications; Infomaniak offers a corresponding service for this purpose.
Specify the sender's address
To ensure that messages are sent correctly from your CMS/web application (and to avoid errors such as Could not instantiate mail function
or sender mismatch
) it is necessary to specify a valid address in the site parameters on the Infomaniak side:
- Click here to access the management of your product on the Infomaniak Manager (need help?).
- Click directly on the name assigned to the product in question.
- Click on Manage under Advanced settings:
- From the General tab, enter an existing email address in the Sender Email field.
- Click on the blue Save button:
Re-enable the mail function
If you still want to use PHP's mail function, you will need to enable it for each of the sites in your concerned Web Hosting:
- Click here to access the management of your product on the Infomaniak Manager (need help?).
- Click directly on the name assigned to the product in question.
- Click on Manage under Advanced Settings.
- From the PHP / Apache tab, enable the mail function:
- Click on the blue Save button.
PHP mail() examples...
... on WordPress
Configure the sending of the default contact form included with Divi Builder:
- Log in to the WordPress admin panel.
- Go to the Divi editor of the page containing the contact form.
- Click on the Settings icon ‍ to configure 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@le-nom-de-votre-site
and if you reply, the recipient will automatically be the email address indicated by the visitor when filling out the contact form.
... on Prestashop
Go to the advanced settings of Prestashop:
- Specify the SMTP mode.
- Enter
localhost
as the server. - Enter the port
25
. - Do not specify a username or password.
... on Joomla
Configuring email sending via PHPmail (not recommended) in Joomla:
- Log in 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 test send via the button, but it will work if you configure 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 PHP's mail() function, the return-path
will be in the form of root@h2web3.infomaniak.ch
for example. However, the Reply-To:
header present in your form code allows you to specify a valid reply address.