• No results found

Configuring Microsoft Dynamics AX 2012 Alerts and Notifications Using an SMTP Relay Server with Office 365

N/A
N/A
Protected

Academic year: 2021

Share "Configuring Microsoft Dynamics AX 2012 Alerts and Notifications Using an SMTP Relay Server with Office 365"

Copied!
22
0
0

Loading.... (view fulltext now)

Full text

(1)

1

Configuring Microsoft Dynamics AX 2012 Alerts and Email Notifications

Using an SMTP Email Relay Server with Office 365

With more AX Server machines being run in the cloud on Microsoft Azure we need a simple way to connect Dynamics AX 2012 to cloud hosted mail servers without the need to run Exchange server in the same Azure virtual network (vnet) as our Dynamics AX servers. Currently the demo images that Microsoft provides for download all rely on a dedicated VM (AX2012R2B) running Exchange Server to send email alerts and workflow messages. This is not a practical or a realistic current scenario with Dynamics AX servers running on Microsoft Azure. The Life Cycle Services demo image that gets generated does not even include a mail server image to distribute notification emails. Today with more clients running with Office 365 we need a way to connect our hosted AX servers to a cloud hosted email service.

The challenge is that most cloud based email services running today require SSL or TLS secure encryption for authentication and unfortunately Dynamics AX 2012 does not support this additional authentication natively. There are a number of ways to customize Dynamics AX to support this additional secure authentication but it is much easier to use a Windows Server Simple Mail Transfer Protocol (SMTP) server as a relay. There are no additional costs to run an SMTP server as this is a feature included in Windows Server. This article will walk through the steps to configure the Windows Server 2012 R2 SMTP Feature to act as a relay to Office 365 as well as how to configure Dynamics AX mail settings to support this scenario.

First consider where to install the SMTP service in your production environment. If you are using Workflow extensively you will have at least one dedicated workflow batch server. Depending on the volume of messages consider placing the SMTP service on this dedicated workflow batch server. Avoid installing the SMTP service on the production database server as a best practice. However for demo systems it works fine to include the SMTP service on the all in one server machine. For this article we will configure the SMTP service on a Dynamics AX2012 R3-CU8 demo image generated from Life Cycle Services.

This article only covers email alert and workflow messages. Microsoft also now has integration with Exchange Server either on premise or on Office 365 for the Sales and Marketing module for

Account/Contacts, tasks and calendar. This integration is available but not in the scope of this article. One more note about flooding SMTP messages from your server to the mail provider. You want to avoid any extremely large volumes of relay messages so you don’t get blacklisted. Just keep this in mind to avoid this situation.

We will cover the following topics throughout this article:

 Installing the SMTP Server

 Configuring the SMTP Server

o Testing SMTP Relay Messages

o Troubleshooting SMTP eMail Sending

 Configuring Dynamics AX to use Windows SMTP Server

 Configuring Alert eMail Messages

 Testing Alert eMail Messages

(2)

2

Conclusion

Dynamics AX servers running in the cloud on Azure can be easily configured to send mail notifications relaying from cloud hosted mail servers such as Office 365 and Gmail without the need to have a dedicated exchange server also running in the cloud. Using this simple configuration you can leverage cloud mail systems reducing the licensing and system machine costs required to run dedicated Exchange Servers in the same virtual location as Dynamics AX.

Dynamics AX 2012 Azure SMTP Server Relay

Azure Office 365 Outlook Client

M es sa ge Fl o w Windows SMTP Server Outlook Dynamics AX Server Alert/Workflow Messages

(3)

3

Installing the SMTP Server

The first step is to add the SMTP feature to windows server from the server manager, Manage, Add Roles and Features. Then step through the wizard screens below to complete the installation process. This next process is driven from the following Microsoft technical article but shows step by step visuals of how this is done.

(4)

4

(5)
(6)
(7)
(8)

8

Configuring the SMTP Server

(9)
(10)
(11)
(12)

12

(13)

13

Testing SMTP Relay Messages

You should always test the sending of SMTP messages through the relay before configuring Dynamics AX. This can help avoid confusion and difficulty in troubleshooting later on in the process. In order to test the sending of SMTP message first create a txt file in Notepad with the following information (using your own email addresses of course:

FROM: [email protected] TO: [email protected]

SUBJECT: Test email

This is a test email sent from my SMTP server

Make sure that the FROM: address is the user that can authenticate on the remote mail server. 1) Drop the text file in the folder C:\inetpub\mailroot\Pickup

(14)

14

Troubleshooting SMTP eMail Sending

Note the folders in the C:\inetpub\mailroot\ folder. You will use these to troubleshoot the service operation.

If you don’t get the message then check if there are any files in the C:\inetpub\mailroot\Badmail folder. This folder will have details of the issue. At first I did not have the messages using the authenticated Office 365 user and got a bounced message similar to below:

(15)

15

Configuring Dynamics AX to use Windows SMTP Server

Now that we have messages successfully sending from the SMTP server sitting in Azure we can easily configure Dynamics AX to use this server to distribute mail messages. Since the SMTP server is running on the same virtual machine you only need to specify the current server name. You also need to specify a user that has access to the Local SMTP server. This user does not have to be a valid Office 365 user and should be local to the domain and machine that is running the SMTP service.

Configuring Alert eMail Messages

(16)

16

Don’t forget to set a batch group on the general tab. This will be used when we launch the batch job to distribute alert email messages.

(17)

17

For the test just make sure you have a valid external email address in File, Tools, User Options.

Testing Alert eMail Messages

(18)

18

In our example we will create an alert rule every time the credit limit is changed. Create the Alert rule as follows and select to send e-mail.

Normally you would be running an alert processor batch job. For this simple test navigate to the AOT, forms and open the Tutorial_EventProcessor and click the start button. While running the label on the Start button will change to Stop.

(19)

19

Within a few seconds you will see the Alert message from within the AX rich client.

(20)

20

A few minutes later the message is sent to my regular company email account external to the local image. Success!

Using Gmail as an SMTP Mail Server

Let’s try the same thing using Gmail. We just have to make a few changes to our SMTP server configuration in order to make the same process work with Gmail.

(21)
(22)

22

Now go ahead and change the credit limit again. You will see the alert message from AX.

References

Related documents

the choice of using an on-premises Exchange Server, hosted Exchange Server, Microsoft Office 365, or some other messaging solution.” Office 365 is perfect for small businesses,

Tropical Business Solutions also has a product like this called Tropical Cloud Mail Protection, which even works with other mail servers (such as google mail or office 365), and

Supported Email Systems Microsoft Exchange Server and Office 365 All IMAP- and POP3-compatible email servers MDaemon, IceWarp, and Kerio email servers Microsoft Outlook

Office 365 is a cloud-based service hosted by Microsoft that brings together familiar Microsoft Office desktop applications with business-class email, shared calendars,

Integrated / Hybrid Identity as the control plane Simple connection Cloud SaaS Azure Office 365 Public cloud Other Directories Windows Server Active Directory. On-premises

1.4 Manage the email systems based on Microsoft Office 365 using single sign-on 1.5 Manage the multiple database servers running Microsoft SQL Server 2008 / R2.. 1.6 Manage

• SMTP protocol between mail servers to send email messages. • client: sending mail server • server: receiving

• Lab : Monitoring SQL Server by Using Alerts and Notifications º Configuring Database Mail. º Implementing Operators and Notifications º