Overview
This training article explains the configuring of the SMTP settings and testing their functionality. The article clarifies different types of emails that DNN sends, how to customize them, and how to troubleshoot issues that arise with SMTP.
Prerequisites
- Access to a DNN test site
- A development SMTP client such as Smtp4Dev
Introduction
Instant Emails - What is a DNN Instant Email?
- Instant emails are a very common type of email.
- Instant emails are used by many default functions such as password reset, account registrations, and role modifications.
- "Instant" means the emails are sent exactly when an action occurs on the site, i.e. clicking a button.
Instant emails are fully automated.
Instant Emails - Three Key Facts
- An instant email is generated directly in the code by a method such as SendEmail().
- This functionality has been around since the beginning of DNN.
- The email content can be configured by modifying the templates stored in a resource file located in the App_GlobalResources folder in your main DNN folder for the website.
You may also ask, so what about other emails such as direct messages and site notifications? Are they "instant" as well? For these instances, this functionality is handled by the Message Dispatch.
Message Dispatch - What exactly is Message Dispatch?
In short, Message Dispatch is a scheduled task that sends emails based on user and message specific settings.
Message dispatch has the ability to pool emails and send them as a single dispatch message. By pooling and sending as a single dispatch, users avoid being spammed.
Here are some common issues with Message Dispatch:
- If there are any issues with the scheduled task itself, the emails will not be sent.
- To compound this problem, any emails which are not sent will sit in the queue.
- If the task is enabled again, it will immediately start sending the oldest messages first.
The Message Dispatch task pulls emails from the CoreMessaging_MessageRecipients table in the database using a stored procedure. By looking at that table directly with SSMS can give you an idea of which emails are pending.
Some emails are grouped up into a “digest” which is sent at scheduled intervals. Users can set the frequency.
The Message Dispatch can also send instant emails, which is the default behaviour for private message notifications. However, these are still only sent when the scheduled task executes, so there could be up to a 59-second delay when using the default 1-minute schedule.
Core Messaging - What is Core Messaging?
Core messaging framework is used to send private messages between users & roles. Every unread message will generate an email message to notify the recipient.
The Core Messaging inbox is a module used to display private messages and notifications. You can also send messages to an entire role, which is a quick way to generate an email to all of those users.
All private messages are stored in the CoreMessaging_Messages table in the database.
Automated Notifications - What are Automated Notifications?
Automated notifications are used to alert users that something occurred or they need to take action.
- Automated notifications are created by functions in the code.
- All unread notifications will generate an email message to notify the recipient.
Here are some different types and examples of notifications:
Action Example - Approval
|
Information Example - Subscription
|
Content Link
|
It is important to note that Notifications & Core Messaging are shared in the same table. If you ever need to know where to find information generated by both Notifications and Core Messaging, the information is stored in the CoreMessaging_Messages table in the database.
Toast Skin Objects - What are Toast Notifications?
The toast skin object displays currently active users when they receive new notifications.
- The toast skin object is a control that is embedded in the skin.ascx files.
- If a notification is toasted to a user, then it will mark the notification as “read” and will not generate an email.
- Toasted messages do not appear when a user is not active. An email is sent instead of the toasted message.
Description
First of all, to enable email features and functionality, we will need to set up the SMTP server.
SMTP Test Environment
For our testing purposes, we can set up a test environment for the SMTP server.
A program such as SMTP4dev will allow you to have a local SMTP server to trap outgoing emails.
Follow the steps, below:
- Start by downloading smtp4dev.
- Follow the instructions.
In some cases, you need to determine whether the problem is in the application or in the SMTP server in your environment. To do that you need a way to isolate the components. That is where a test server comes into play.
Configuring SMTP Server Settings
When the SMTP settings are not configured properly, the entire email system does not work. Correct SMTP settings configuration is vital to effectively send emails.
Key Information About SMTP Server Settings
- These settings are used by the application to connect to an SMTP server.
- The exact settings needed will depend on the specific SMTP server.
- The settings are located in the PortalSettings and HostSettings tables in the database
- The Test SMTP Settings button will send an instant email to the portal administrator.
Common Usage
Here are a couple of common articles regarding emails, notifications and the SMTP server:
- Changing the Email Address for DNN SMTP and Form Builder Notifications - This issue is one of the most common questions that are submitted by DNN customers where the users would like to change the email address that sends out DNN notifications to their users. This is not accessible through the DNN UI, but is changeable through the backend.
- Changing the frequency of email notifications in EVOQ - This article details how to change the frequency of email notification that DNN users receive once a certain action has been performed. Customers will submit tickets where Users are not receiving emails frequently and this setting should be the first thing you should check.
Comments
0 comments
Please sign in to leave a comment.