Frontend Configuration
The Exchange 365 Mailer extension supports frontend email sending through popular TYPO3 extensions like Powermail, Form Framework, and other form extensions. This requires additional TypoScript configuration to work properly.
Attention
Frontend configuration is required for any page that uses forms or email functionality. Without proper TypoScript setup, frontend forms will not be able to send emails through Exchange 365.
Frontend Configuration Overview
Frontend email sending requires the same 5 core parameters as the backend configuration, but they must be configured via TypoScript instead of environment variables or LocalConfiguration.php.

Required TypoScript Parameters
The following 5 parameters must be configured in your TypoScript setup for frontend email functionality:
-
Transport Class Configuration
Set the mail transport to use the Exchange365Transport class for frontend operations.
config.mail.transport = OliverKroener\OkExchange365\Mail\Transport\Exchange365Transport
Copied!Note
This tells TYPO3 to use the Exchange 365 transport instead of the default SMTP transport for frontend emails.
-
Tenant ID
Configure your Microsoft Entra ID tenant identifier.
plugin.tx_okexchange365mailer.settings.exchange365.tenantId = your-tenant-id-here
Copied!Attention
Replace
your-
with the actual Tenant ID from your Azure Configuration (step 4).tenant- id- here -
Client ID
Set your Azure application's client identifier.
plugin.tx_okexchange365mailer.settings.exchange365.clientId = your-client-id-here
Copied!Attention
Replace
your-
with the actual Client ID from your Azure Configuration (step 4).client- id- here -
Client Secret
Configure the Azure application's client secret.
plugin.tx_okexchange365mailer.settings.exchange365.clientSecret = your-client-secret-here
Copied!Warning
- Replace
your-
with the actual Secret Value from your Azure Configuration (step 7)client- secret- here - Security Risk: TypoScript is visible in the frontend source. Consider using Essential Configuration with environment variables for production
- Never expose this value in public repositories or frontend debugging
- Replace
-
From Email Address
Set the sender email address for frontend-generated emails.
plugin.tx_okexchange365mailer.settings.exchange365.fromEmail = service@your-domain.com
Copied!Note
- Replace
service@your-
with a valid email address from your Exchange 365 environmentdomain. com - This email must exist as a SharedMailbox or User Mailbox in your organization
- If not specified, falls back to
config.
mail. default Mail From Address
- Replace
-
Save to Sent Items (Optional)
Determine whether frontend emails should be saved to the sender's "Sent Items" folder.
plugin.tx_okexchange365mailer.settings.exchange365.saveToSentItems = 1
Copied!Note
- Set to
1
to save emails to Sent Items folder - Set to
0
to skip saving emails to Sent Items folder - Default value is
0
if not specified
- Set to
Complete TypoScript Configuration Example
Here's a complete TypoScript setup example for frontend email functionality:
# Exchange 365 Frontend Mail Configuration
config {
mail {
# Set transport to Exchange 365
transport = OliverKroener\OkExchange365\Mail\Transport\Exchange365Transport
# Optional: Default mail settings
defaultMailFromAddress = service@your-domain.com
defaultMailFromName = Your Organization Name
}
}
# Exchange 365 specific configuration
plugin.tx_okexchange365mailer {
settings {
exchange365 {
# Azure/Microsoft Entra ID Configuration
tenantId = your-tenant-id-here
clientId = your-client-id-here
clientSecret = your-client-secret-here
# Email Configuration
fromEmail = service@your-domain.com
saveToSentItems = 1
}
}
}
Integration with Form Extensions
Powermail Integration
When using Powermail, the extension will automatically use the configured Exchange 365 transport for sending emails:
plugin.tx_powermail {
settings {
setup {
# Powermail will use the global mail configuration
# No additional configuration needed
}
}
}
TYPO3 Form Framework Integration
For the TYPO3 Form Framework, ensure your form configuration references the global mail settings:
# In your form configuration (YAML)
finishers:
-
identifier: EmailToReceiver
options:
# Uses global mail configuration automatically
recipientAddress: 'recipient@example.com'
recipientName: 'Recipient Name'
Configuration File Locations
Place your TypoScript configuration in one of these locations:
- Template Records
- Add the configuration to your main TypoScript template record in the TYPO3 backend.
- Static Files
-
Create or modify files in your site package:
Configuration/
Typo Script/ setup. typoscript Configuration/
(for constants)Typo Script/ constants. typoscript
- Page TSconfig (Not recommended for mail settings)
- Only use for page-specific overrides, not for global mail configuration.
Security Considerations for Frontend
Danger
TypoScript Security Warning
TypoScript configuration is potentially visible in frontend source code and through various debugging tools:
- Client Secret Exposure: Never use sensitive secrets in TypoScript on production sites
- Recommended Approach: Use Essential Configuration with environment variables
- Alternative: Use TYPO3's encrypted configuration features for sensitive data
- Monitoring: Regularly audit your TypoScript for exposed credentials
Best Practices
-
Environment-Specific Configuration
Use different Azure applications for different environments:
[applicationContext == "Development"] plugin.tx_okexchange365mailer.settings.exchange365.clientId = dev-client-id plugin.tx_okexchange365mailer.settings.exchange365.tenantId = dev-tenant-id [END] [applicationContext == "Production"] plugin.tx_okexchange365mailer.settings.exchange365.clientId = prod-client-id plugin.tx_okexchange365mailer.settings.exchange365.tenantId = prod-tenant-id [END]
Copied! -
Conditional Loading
Only load Exchange 365 configuration when needed:
[siteIdentifier == "main-site"] <INCLUDE_TYPOSCRIPT: source="FILE:EXT:site_package/Configuration/TypoScript/exchange365.typoscript"> [END]
Copied! -
Fallback Configuration
Always provide fallback settings:
config.mail { defaultMailFromAddress = fallback@your-domain.com defaultMailFromName = Fallback Sender }
Copied!
Testing Frontend Configuration
To test your frontend configuration:
- Create a test form using Powermail or Form Framework
- Submit the form and verify email delivery
- Check TYPO3 logs for any authentication or sending errors
- Verify in Exchange 365 that emails appear in the sender's mailbox (if saveToSentItems is enabled)
Tip
Use TYPO3's mail spooling functionality during development to prevent sending actual emails while testing configuration.
Troubleshooting Frontend Issues
Common issues and solutions:
- Emails not sending
-
- Verify all 5 parameters are correctly configured in TypoScript
- Check that the Azure application has proper permissions
- Ensure the sender email exists in Exchange 365
- Authentication errors
-
- Verify Tenant ID and Client ID are correct
- Check that the Client Secret is valid and not expired
- Confirm Azure admin consent has been granted
- Permission errors
-
- Ensure the Azure application has
Mail.
permissionSend - Verify the sender email address exists in your Exchange 365 environment
- Check that the application can send on behalf of the specified user
- Ensure the Azure application has
See also
For backend configuration details, see Essential Configuration. For Azure setup instructions, see Azure Configuration.