31
Mar2011
0 comments
NAV2009R2 DotNet SMTP Add-in
by Steve
in Technical
NAV 2009 R2 introduced a new data type - DotNet. Sounded like a good idea but was there any practical use for it? Yes there is.
We had a situation where a client wanted to email a large number reports in batch process. The most logical approach would be to use
- SaveAsPDF for each report
- the SMTP module built into Codeunit 400 - SMTP - to send each report
There are a few inherit problems with using Codeunit 400
- No exception handling
This is a general C/Side issue - sight
This was a real problem as the process would stop on an invalid email address. Validating the address will not solve this issue because while the address may be structurally correct when the SMTP client tries to send it will error if the address does not exist. - Sending via an SMTP server is slow - a problem when you have thousands of emails to send
The answer was to
- create a c# DotNet class (JigsawNAVEmail) that wraps System.Net.Mail
- use this class via the new DotNet data type
In the JigsawNAVEmail class allows us to use additional delivery methods
- Via IIS drop folder
Requires SMTP Mail to be setup on the IIS Server - Via Specific drop folder
The advantage of using delivery via IIS is that "Send" simply creates a file on the local hard drive = fast. IIS SMTP then takes over and delivers the email. (We setup IIS to deliver via a smarthost being the clients Exchange Server)
There are two parts to this solution
- JigsawNAVEmail Class
- Code unit to wrap and expose the functions
Both of these are provided in the zip below. Use at your own risk.
Categories
Recent Posts
Archives
- 2019
- 2015
- 2014
- 2013
- December
- November
- October
- Downsizing Dangers - 28th October 2013
- Dynamics NAV NAS/Job Queue - Excel SaveAs method failed - 18th October 2013
- New in XLCubed 7.5 - 16th October 2013
- How to suspend and resume SQL database mirroring - 15th October 2013
- XLCubed: Excel Dashboards - 11th October 2013
- Analytical Applications of Business Intelligence Reporting - 10th October 2013
- What is Microcharts? How can it clarify data? - 10th October 2013
- Can’t print from XLCubed Web Edition - 2nd October 2013
- September
- June
- February
- January
- 2012
- 2011
- November
- August
- July
- May
- A call to SSPI failed in NAV 2009 R2 - 31st May 2011
- Can’t send BizTalk documents from NAV2009 Role Tailored Client - 23rd May 2011
- Unique External Document No. on Sales Order - 23rd May 2011
- CRM 2011 – NAV 2009 R2 Synchronisation – tips and tricks - 10th May 2011
- Manually Create NAV Service Instances - 3rd May 2011
- April
- March
- February
- January
- 2010
- December
- November
- SQL Maintenance plan won't run, modify or delete - 24th November 2010
- Miscellaneous NAV RTC Development Tips - 21st November 2010
- NAV RTC Development training tools - 18th November 2010
- Microsoft Dynamics NAV Application Objects - 15th November 2010
- Delete a rogue Conur Expense Report - 12th November 2010
- CRM - 9th November 2010
- October
- September
- February
Tags
- 2009
- 64bit
- antivirus
- application objects
- BI
- BizTalk
- blocking
- Business
- Business Intelligence
- c#
- C#
- cached password
- calculation
- CGRS
- Cloud
- Commerce Gateway
- concur
- CRM 2011
- CRM 2013
- Crystal Reports
- csv
- Data Type
- date and time
- deadlock
- delete
- DotNet
- Downsizing
- Dynamics
- Dynamics NAV
- EDI
- ERP
- Excel Buffer
- External Document No.
- Generate xsd from SQL table
- impersonation
- Jigsaw
- Job Queue
- MDX
- Microsoft Excel
- NAS
- NAV
- NAV 2009
- NAV 2009 R2
- NAV Application Server
- NAV Development
- NAV Upgrade
- NAV2009
- NAV2013R2
- NAV2015
- Navision
- new version
- no delimiter
- NST
- OLAP
- Permissions
- printing
- regsvr32
- right-click
- security
- Security
- service broker
- SMTP
- SQL
- SSPI
- SSRS
- sync
- synchronisation
- umbraco
- upgrade
- User Setup
- Web Service
- xlcubed
- xmlport
- xp_ndo
- xp_ndo_enumusergroups
- xp_ndo_enumuserids