🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
Turnkey email settings
This page was created by Lars.olofsson on 2019-08-16. Last edited by Wikiadmin on 2026-07-29.

You can configure the SMTP service that sends email from server-side jobs in your MDriven Turnkey application; this page is for Turnkey administrators and developers who need those emails to be delivered.

How Turnkey sends email

Email from a Turnkey application is sent by server-side jobs running on the MDrivenServer used by that Turnkey site. Your application prepares an email in a server-side ViewModel, and MDrivenServer submits it through the configured SMTP service.

For example, a password-reset or notification ViewModel can provide a recipient, subject, body, and sender. When its email action runs, MDrivenServer uses its SMTP configuration to deliver the message.

Choose where to configure SMTP settings

You can configure email settings in either location:

Location When to use it Result
MDriven Portal You manage the Turnkey site through the Portal. Applying the Portal settings updates the email settings on the MDrivenServer used by the Turnkey site.
MDrivenServer administration UI You manage the server directly, including local or standalone installations. The MDrivenServer uses the entered SMTP settings when it sends email for server-side jobs.

Configure the SMTP server connection, port, SSL use, and credentials in Documentation:Fill in the email settings in the admin UI. MDrivenServer must be able to reach the SMTP service over the network.

Configure and verify email delivery

  1. Choose an SMTP service that MDrivenServer can access.
  2. Enter its connection and login details in the Portal or MDrivenServer administration UI. Follow Documentation:Fill in the email settings in the admin UI for the available fields.
  3. Apply the settings. When you use the Portal, apply its settings so that the MDrivenServer configuration is updated.
  4. Test the SMTP service independently before diagnosing the Turnkey application. The linked administration-UI guide includes PowerShell examples for testing an SMTP server, including an Office 365 example.
  5. Run an email-producing server-side ViewModel and inspect the SMTP result returned to the ViewModel when available.

Testing outside MDrivenServer separates SMTP connectivity and credential problems from application-model problems. If an external SMTP test fails, correct the SMTP service, network access, or credentials before changing the Turnkey application.

Create the email in a server-side ViewModel

SMTP settings only provide the delivery connection. Your application must also create the email using a server-side ViewModel. See Documentation:Emailing from an app using MDrivenServer for the required action and property names, recipient formats, attachments, CC/BCC, inline content, and send-result properties.

A ViewModel action whose name starts with email triggers sending. The action looks for properties such as to, from, subject, and body. For example, an email can use a recipient in this form:

Customer Support<support@example.com>

You can provide multiple recipients as a comma-separated value. The complete property rules and attachment structure are documented in Documentation:Emailing from an app using MDrivenServer.

Sender address and SMTP login are different

Treat the SMTP login identity and the email sender as separate values:

  • SMTP login is taken from the MDrivenServer email settings.
  • From address is supplied by the server-side ViewModel and is the sender shown on the email.

Always set the from value in the server-side email ViewModel. Omitting it when using a service such as Gmail can result in an SMTP error such as Incorrect login.

For example, the SMTP account may authenticate as mailer@example.com, while the ViewModel uses Support Team<support@example.com> as its from value. Whether the SMTP provider permits that sender address is controlled by the provider.

Gmail notes

Gmail configuration may require an application-specific login rather than the normal account password. MDriven's documented Gmail update records that application login was used after Gmail email delivery stopped working.

Use the SMTP login credentials in the MDrivenServer settings, and set the sender address explicitly in the server-side ViewModel. Do not rely on the obsolete "Less secure app access" instruction in older configurations; use the authentication method currently required by the Gmail account.

Troubleshooting

Symptom Check
No email is delivered Confirm that the SMTP service is reachable from the MDrivenServer and run the independent SMTP test described in Documentation:Fill in the email settings in the admin UI.
SMTP login fails or reports Incorrect login Verify the SMTP login in MDrivenServer settings, the provider's required authentication method, and that the ViewModel provides from.
The wrong sender appears, or sending is rejected for the sender Check the ViewModel's from value. The SMTP provider may restrict which sender addresses the authenticated account can use.
The application does not trigger a send Verify that the server-side ViewModel has an action beginning with email and the expected email properties. See Documentation:Emailing from an app using MDrivenServer.
You need the SMTP response in application logic Use the documented emailsendresult feedback property and emailresendadvised indicator in the server-side ViewModel.

See also