Zum Inhalt springen

Configure contact forms & e-mail dispatch in TYPO3

Correctly configure the sending of e-mails in forms or for registrations to other providers (e.g. web.de, t-online.de, gmx.net, gmail.com etc.)

Background information

The following configurations may cause problems with the delivery or sending of emails. This also applies to the configuration of other CMS, please ask your responsible programmer or your agency whether adjustments are necessary.

  • If emails are not sent via a mail server belonging to the domain, the recipient will usually mark the email as SPAM or the email will not be sent by our mail server if an SPF record with -all is stored in the domain's DNS.
  • If emails are sent directly via the web server using Sendmail, the recipient may reject the email if they only allow TLS version 1.2 or higher, as our web server sends emails with TLS version 1.0.
  • When configuring forms, sending is refused if the email address entered in the form has been incorrectly configured as envelope-from (sender address) instead of reply-to (reply address) and the envelope-from email address therefore does not match the domain of the website.

Preparations in the configuration of TYPO3

To ensure that emails from the website are not sent via the web server but via a mail server belonging to the domain or an authorized mail server, a mailbox must be configured in the TYPO3 backend.

The mailbox should only be used for sending emails that are sent from the website, as the password in the configuration file can be read. Therefore, if necessary, create a new mailbox in your customer menu [Configuration ' Manage e-mail addresses] or ask your mail administrator for the data.

TYPO3 Version:9 LTS8 LTS

Configure dispatch via mailbox in TYPO3

TYPO3 9 LTS

Important note: If you are a customer of our cloud hosting, the SMTP server is not sslout.de, but your domain name, e.g. yourdomain.tld

  1. Go to the settings in the backend under the Admin tools module
  2. There, under Configuration Presets, click on Configuration Presets
  3. Open the Mail handling settings section
  4. Enter the data for your mailbox in the corresponding fields, as shown in our screenshot
  5. To save the entered data, click on the Activate button and then close the window by clicking on the X
  6. Complete the configuration of the form using the following instructions

TYPO3 8 LTS

Important note: If you are a customer of our cloud hosting, the SMTP server is not sslout.de, but your domain name, e.g. yourdomain.tld

This guide shows you how to set up e-mail delivery via an SMTP server in the Install Tool.

Store access data in the install tool

  1. Call up the Installtool and go to the All Configuration-> Mail area
  2. Enter the value smtp for the [MAIL][transport] parameter
  3. For the [MAIL][transport_smtp_server] parameter, enter sslout.de:465
  4. For the parameter [MAIL][transport_smtp_encrypt] enter ssl
  5. For the parameters [MAIL][transport_smtp_username] and [MAIL][transport_smtp_password], enter the email address and password of the email account to be used for sending
  6. Then save the configuration by clicking on the Write Configuration button

You can then send yourself an e-mail in the Test Setup area to check whether the dispatch works correctly.

Optionally, you can also set the parameters [MAIL][defaultMailFromAddress] and [MAIL][defaultMailFromName] in the All Configuration -> Mail area to define the default sender address and the default name for outgoing emails. However, this does not necessarily have to be done.

Configure forms created with Form

Necessary adjustments

  1. Call up the Forms page module
  2. Select the form you have set up
  3. Expand the Send e-mail (recipient) option on the right-hand side
  4. Change the sender address to the email address with which you send the emails via SMTP.
  5. Enter the marker (e.g. {email-1}) in the Reply-To field. The marker is the name of the field in which the sender's e-mail address is entered.
  6. In the plugin, where the form is integrated, check whether a different configuration (Overwrite finisher) has been stored. This must also be adjusted if necessary.

What has changed?

When configuring the form extension, the email address entered in the form is stored by default for the copy to the recipient. As the sending mail server and the sender e-mail address are different, the e-mails are no longer delivered to the recipient, as the e-mail providers prohibit this by means of an SPF entry in their own name servers.

Before the configuration, the notification emails were sent to the address stored in the plugin, but the From: email address of the visitor was used as the sender. This means that the so-called "Sender Policy Framework" procedure (SPF check) cannot classify the email as trustworthy and the email is not even sent. By changing the sender address, the email is sent correctly via the domain's mail server.

TYPO3 Version:9 LTS8 LTS

Configure forms created with Powermail

If the option "This field contains the sender's email" is activated when configuring the Powermail form, Powermail sets the email address entered as the sender address (envelope-from). This ensures that some providers do not send the email, as the email address does not match the sending mail server and this is often used by spammers to forge sender addresses.

Necessary adjustments

  1. Mail should generally be sent via an SMTP server
  2. The sender address of the form must match the sending address
  3. The reply-to e-mail address must be set so that the sender of the form can be replied to

Up to the current version, Powermail unfortunately does not offer the option of carrying out this configuration via the plugin user interface. This requires a few lines of TypoScript.

To do this, open the "Template" module in the backend. If the Powermail static template is integrated directly on the root page, select this in the page tree. Otherwise, either select the contact page or add it to the TypoScript directly in the site package.

We now add the following lines of TypoScript under "Setup" and adjust the values after the .value = accordingly:

plugin.tx_powermail.settings.setup.receiver.overwrite.senderEmail = TEXT
plugin.tx_powermail.settings.setup.receiver.overwrite.senderEmail.value = typo3server@domain.tld
plugin.tx_powermail.settings.setup.sender.overwrite.senderEmail = TEXT
plugin.tx_powermail.settings.setup.sender.overwrite.senderEmail.value = typo3server@domain.tld

The e-mail address must match the e-mail address stored in the configuration. If you do not know which e-mail address has been configured, you can look it up under Preparations in the TYPO3 configuration.

Then save the configuration and empty all caches. The notification emails will then be sent correctly again.

What has changed?

Before the configuration, the notification emails were sent to the address stored in the plugin (in our example admin@domain.tld), but the From: email address of the visitor was used as the sender. This means that the so-called "Sender Policy Framework" procedure cannot classify the email as trustworthy and the email is not even sent. With the TypoScript configuration, we overwrite the sender with our own e-mail address, but leave the reply address Reply-To: at the visitor's e-mail address so that we can reply to contact requests by e-mail as usual.

TYPO3 Version:9 LTS8 LTS
Updated: 17.07.2024