Avoid Sending Emails in a Non-production System for Microsoft Dynamics AX 2012

Posted on: August 16, 2017 | By: Jarrod Kraemer | Microsoft Dynamics AX/365

Authored by: Craig Leska – Senior Technical Consultant

When working on non-production system for development or testing, you may not always know what tasks the system is preforming on the back end and sometimes there is a possibility of inadvertently sending out emails. The last thing you want to do is send out a purchase order or sales order confirmation out to a customer from your development or test system.

There are several ways around this.  Firstly, you can delete the SMTP entry.  If you are doing functional testing this may lead to errors and not complete test scenario. I like to go the other route and actually send the email, but I like to use an SMTP simulator called SMTP4Dev, which is available for download on GitHib.

Installation couldn’t be easier, you just download, then extract, and finally run the program. SMPT4DEV runs in the system tray and you can confirm that is listening on the standard port by doing the old telnet to port 25 test (or whatever port you have configured this for as it is fully configurable).

Now that we have SMTP4DEV installed and running, we need to configure AX, which is just as easy. Navigate to System administration> Setup> System> E-mail parameters and enter the server that SMTP4DEV is running on, typically the same as the AOS. Since everything is running on the same AOS, I simply enter localhost as the Outgoing email server name with the default port of 25.

E-mail parameters in AX setup

 

Telnetting to port 25 on localhost should give us results like this below.

 

SMTP4Dev running in the system tray.

 

After we have all our configuration set up, we can go into AX and run the process that emails out.  In this example, a standard Pick List is being generated and sent out via the batch functionality. Because the SMTP engine is listening, once AX starts the process things flow smoothly out of AX and into the engine.  Here we can see our message instantaneously. Using SMTP4Dev we don’t have to submit the message to any email queues and hope that our message doesn’t get flagged as spam along the way or we inadvertently send outside the organization to customers or vendors.

Now we can click View to open the email message or Inspect to inspect the email header.

Clicking View will open the message in your default email program. Outlook in the example below.

 

In short, SMTP4Dev can be used for any application and not only AX. I encourage you to download it and start using it in your development and testing.  

For additional information please feel free to reach out to us at info@loganconsulting.com or (312) 345-8817. 

All the best!
Logan Consulting
www.loganconsulting.com