by Peter Schellenbach and Joe Goldthwaite
We get a lot of requests for help with various projects involving AccuTerm and Microsoft Office. One of the more common requests is for techniques that you can use to automatically send email from your MultiValued database application. Let’s say you have a customer contact application and one of your customers calls with a request for some information. You’d like to be able to press a button and have your MV app automatically email the information to the customer. Well the good news is you can!
There are a number of ways to accomplish this task. Which one you choose depends on your requirements and what type of email client you’re using. In this article, we’ll explore four different methods: SMTP, Outlook, Collaborative Data Objects (CDO), and MAPI. Except for SMTP, you’ll need to have your Windows based email client configured and working first. This is because each of the above methods (except SMTP) use your current email client to perform the actual email send operation. If you don’t have email working on the client computer, these other methods will not work.
Outlook is the Email client that comes with Microsoft Office. It is the most common. It is also the simplest in that it uses the cleanest object model of the three methods. Of course to use this method, you must be using Outlook as your Email client. The disadvantage of the Outlook method is that it’s slower and requires lots of memory. CDO is another object model from Microsoft. It’s similar in some ways to the Outlook object model. It’s much smaller however and in our experience, it’s faster than Outlook and takes up less memory. The object model for CDO is more complex, and harder to install and get running. MAPI stands for Messaging Application Programming Interface. It’s Microsoft’s original attempt at standardizing the methods of sending Email. MAPI predates the other methods and it works at a much lower level. Because of this, it’s the hardest to work with and debug. It has an advantage in that it works with other Email clients besides Outlook, including Outlook Express and Eudora. It also requires the least amount of memory and because it works at a lower level, it is the fastest of the three methods.
In order to get the most from this article you should have some familiarity with Visual Basic or with the AccuTerm scripting language. If you haven’t worked with VB, you might want to get one of the many books on the subject and study up. It will be time well spent. The samples here have been tested with AccuTerm 2000, AccuTerm 2K2 and AccuTerm 7.