Set up email delivery
The mailer supports sending via SMTP or Sendmail. Please store the required settings as server-side environment variables rather than directly in the PHP file. This ensures that login details remain secure and allows the mailer file to be updated independently of the server configuration.
- Configure the general settings.
The following details are used regardless of the email transport method selected:
Variable Meaning Standard value MAIL_FROM_ADDRESS Sender address of the emails sent - MAIL_IMPORT_RECIPIENT Email address to which the import email is sent - MAIL_FROM_NAME Displayed sender name Online Bookings MAIL_IMPORT_SUBJECT Fixed subject line of the import email is generated automatically MAIL_CSS_FILE Full path to the production CSS file mailer.css (next to the PHP file)
MAIL_FROM_ADDRESS and MAIL_IMPORT_RECIPIENT are mandatory fields and must contain valid email addresses.- If MAIL_IMPORT_SUBJECT is not set, the mailer automatically generates the subject line based on the language, the transaction type and the title of the online booking.
- If MAIL_CSS_FILE is not set, the mailer expects the file mailer.css to be in the same directory as the PHP file.
- If you are using your own CSS file, enter its full path.
- Set up email delivery either via SMTP or via Sendmail. SMTP is the recommended option.
Option 2: Set up email delivery using Sendmail
The mailer logs in to a mail server using a user account. Please also enter the following settings:
| Variable | Meaning | Standard value |
| MAIL_TRANSPORT | Email transport | smtp |
| SMTP_HOST | Name of the SMTP server | - |
| SMTP_USER | SMTP account username | - |
| SMTP_PASS | SMTP account password | - |
| SMTP_PORT | SMTP server port | 587 |
| SMTP_SECURE | Encryption: starttls or smtps | starttls |
This template only supports SMTP with authentication. SMTP_HOST, SMTP_USER and SMTP_PASS are therefore mandatory.
Common combinations are:
Port 587 with starttls
Port 465 with SMTPS
You can obtain the correct connection details from the mail server operator. Use a sender address that is authorised for the SMTP account you are using.
Example:
MAIL_TRANSPORT=smtp
MAIL_FROM_ADDRESS=
MAIL_FROM_NAME=Online-Buchung
MAIL_IMPORT_RECIPIENT=
MAIL_CSS_FILE=/full/path/customer-mailer.css
SMTP_HOST=smtp.example.com
SMTP_PORT=587
SMTP_USER=smtp-user
SMTP_PASS=GEHEIMES-PASSWORT
SMTP_SECURE=starttls
Option 2: Set up email delivery using Sendmail
Only use Sendmail if a fully functional local mail delivery system is already set up on the external web server. This is set up by the customer’s IT department or the hosting provider.
Configure the following settings:
MAIL_TRANSPORT=sendmail
MAIL_FROM_ADDRESS=
MAIL_FROM_NAME=Online-Buchung
MAIL_IMPORT_RECIPIENT=
MAIL_CSS_FILE=/full/path/customer-mailer.css
The variables SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASS and SMTP_SECURE are not used with Sendmail. There is no need to specify a separate Sendmail path; PHPMailer uses the existing server configuration.
- Save the settings securely. It is recommended that you store the environment variables as follows:
- in the hosting control panel,
- in the web server or PHP-FPM configuration, outside the publicly accessible web directory,
- in Apache, or alternatively in a protected .htaccess file.
In particular, do not store the SMTP password in mailer.php, mailer.css or any other publicly accessible file.
If you are using nginx or your own PHP-FPM configuration, the customer’s IT team will set up the variables in line with the server environment. Following any changes, it may be necessary to restart PHP, PHP-FPM or the web server. You should then check whether PHP can actually read the variables.