DigitalWonderlab.MultiDomainEmail
2.3.2
dotnet add package DigitalWonderlab.MultiDomainEmail --version 2.3.2
NuGet\Install-Package DigitalWonderlab.MultiDomainEmail -Version 2.3.2
<PackageReference Include="DigitalWonderlab.MultiDomainEmail" Version="2.3.2" />
<PackageVersion Include="DigitalWonderlab.MultiDomainEmail" Version="2.3.2" />
<PackageReference Include="DigitalWonderlab.MultiDomainEmail" />
paket add DigitalWonderlab.MultiDomainEmail --version 2.3.2
#r "nuget: DigitalWonderlab.MultiDomainEmail, 2.3.2"
#:package DigitalWonderlab.MultiDomainEmail@2.3.2
#addin nuget:?package=DigitalWonderlab.MultiDomainEmail&version=2.3.2
#tool nuget:?package=DigitalWonderlab.MultiDomainEmail&version=2.3.2
Multi-Domain Email & Forms for Umbraco
Multi-domain SMTP and reCAPTCHA support for Umbraco Forms. Perfect for multi-site installations where each domain needs its own email settings and reCAPTCHA keys.
Features
- Multi-Domain SMTP - Different email settings per domain
- Multi-Domain reCAPTCHA - Separate reCAPTCHA keys per domain
- Forms Workflow - Pre-built Umbraco Forms workflow
- Automatic Detection - Detects current domain automatically
- Fallback Support - Falls back to default config when needed
Installation
.NET CLI
dotnet add package DigitalWonderlab.MultiDomainEmail
Package Manager Console
NuGet\Install-Package DigitalWonderlab.MultiDomainEmail
Requirements
- Umbraco CMS 13-17+
- Umbraco Forms 13-17+
- .NET 8.0 (v13-14) or .NET 9.0 (v15-17+)
Configuration
Add to your appsettings.json:
{
"MultiDomainSmtpSettings": {
"example.com": {
"From": "noreply@example.com",
"Host": "smtp.mailgun.org",
"Port": 587,
"Username": "postmaster@mg.example.com",
"Password": "your-password-here",
"SecureSocketOptions": "StartTls"
},
"anotherdomain.com": {
"From": "info@anotherdomain.com",
"Host": "smtp.sendgrid.net",
"Port": 587,
"Username": "apikey",
"Password": "your-api-key",
"SecureSocketOptions": "Auto"
},
"default": {
"From": "noreply@yourdefault.com",
"Host": "smtp.gmail.com",
"Port": 587,
"Username": "your-email@gmail.com",
"Password": "your-password",
"SecureSocketOptions": "StartTls"
}
},
"MultiDomainRecaptcha": {
"example.com": {
"SiteKey": "6Lc-your-site-key",
"PrivateKey": "6Lc-your-private-key"
},
"anotherdomain.com": {
"SiteKey": "6Lc-different-site-key",
"PrivateKey": "6Lc-different-private-key"
},
"default": {
"SiteKey": "6Lc-default-site-key",
"PrivateKey": "6Lc-default-private-key"
}
}
}
Usage
Using the Umbraco Forms Workflow
- Create or edit a form in Umbraco backoffice
- Add the "Multi-Domain Email" workflow
- Configure settings:
- Email - Recipient email address
- Subject - Email subject line
- Show All Form Fields - Include all fields (checkbox)
- Custom Message - Optional message
- Send Copy To Submitter - Send confirmation email (checkbox)
- Submitter Email Field - Field alias for submitter's email
The workflow automatically uses the correct SMTP settings for the current domain.
Using Multi-Domain reCAPTCHA
To use reCAPTCHA v3 with Umbraco Forms across multiple domains:
- Configure your reCAPTCHA keys in
appsettings.json(see Configuration section above) - Add a reCAPTCHA field to your Umbraco Form:
- In the form designer, add a new field
- Choose "Recaptcha 3" as the field type
- The package automatically handles the rest - each domain will use its own reCAPTCHA keys
Note: The reCAPTCHA configuration only affects Umbraco Forms' built-in reCAPTCHA v3 fields. Custom reCAPTCHA implementations are not affected.
Token Replacement
Use these tokens in subject or custom message:
{fieldName}- Any form field (e.g.,{Name},{Email}){formName}- Form name{submissionDate}- Submission date/time
Example:
Hello {Name}, thank you for contacting us on {submissionDate}.
How It Works
Domain Detection
- Extracts domain from current HTTP request
- Automatically strips port numbers -
localhost:44322→localhost - Removes
www.prefix -www.example.com→example.com - Case-insensitive matching -
Example.COMmatchesexample.comconfig - Works seamlessly across all environments (localhost, staging, production)
Important: Configure domains without port numbers in your appsettings.json:
- ✅ Correct:
"localhost" - ❌ Incorrect:
"localhost:44322" - ✅ Correct:
"example.com" - ❌ Incorrect:
"example.com:443"
The package automatically handles all ports for each domain, so one config entry works everywhere.
Configuration Fallback
The system follows this priority order when looking for SMTP settings:
- Domain-specific config - Exact match (e.g.,
example.com) defaultconfig - Fallback for unmatched domains- Legacy
SmtpSettings- Umbraco's standard SMTP config (SMTP only, not reCAPTCHA)
Email Template System
Automatic Template Extraction: On first startup, the package extracts customizable email templates to:
~/Views/Partials/Forms/EmailTemplates/
├── AdminNotification.cshtml (Admin notification emails)
├── SubmitterConfirmation.cshtml (Thank you emails to submitters)
└── README.txt
How It Works:
- Custom templates first - If
.cshtmlfiles exist, they're used - Fallback protection - Built-in templates used if custom ones are missing or fail
- Preserved on updates - Your customizations won't be overwritten
- Easy customization - Edit the
.cshtmlfiles directly, changes apply immediately
Two Email Types:
- Admin Notification (
AdminNotification.cshtml) - Always sent to the configured email address - Submitter Confirmation (
SubmitterConfirmation.cshtml) - Optional "thank you" email sent when "Send Copy To Submitter" is enabled
Local Development
For local testing with email capture tools like MailHog or Papercut SMTP:
- Use
localhost(without port) in your configuration - Works with any local port:
:5000,:44322,:3000, etc. - No need to configure multiple entries for different ports
Security
Never commit passwords! Use environment variables or secrets:
# User secrets (development)
dotnet user-secrets set "MultiDomainSmtpSettings:example.com:Password" "your-password"
# Environment variables (production)
export MultiDomainSmtpSettings__example_com__Password="your-password"
Support
Made by Digital Wonderlab
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Umbraco.Cms.Core (>= 17.0.0 && < 18.0.0)
- Umbraco.Cms.Web.Common (>= 17.0.0 && < 18.0.0)
- Umbraco.Forms.Core (>= 17.0.0 && < 18.0.0)
-
net8.0
- Umbraco.Cms.Core (>= 13.0.0 && < 15.0.0)
- Umbraco.Cms.Web.Common (>= 13.0.0 && < 15.0.0)
- Umbraco.Forms.Core (>= 13.0.0 && < 15.0.0)
-
net9.0
- Umbraco.Cms.Core (>= 15.0.0 && < 17.0.0)
- Umbraco.Cms.Web.Common (>= 15.0.0 && < 17.0.0)
- Umbraco.Forms.Core (>= 15.0.0 && < 17.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.