SupportJPG
  Support Home   |   Search   |   Documentation
ArticleId = kb000179

HOWTO: Emailing from AVR Applications.

The information in this article applies to:

    • ASNA Visual RPG, All Versions
    • Windows
    • ActiveX

SUMMARY:

This article will discuss various ways in which AVR Applications can send email.

MORE INFORMATION:

NOTE:  These methods listed below are examples.  There might be other methods in which emailing can be incorporated into an AVR application that is not mentioned in this article.  Please keep in mind, any third party controls used in development will be required to be installed on the client machines.

There are several ways in which you can send email:

TIP:  The version of Outlook (e.g. Outlook 2000, Outlook Object v 9.0 Library) used in development has to be the same version as the client.

We have several examples using Outlook.  They are located in "C:\Program Files\ASNA\Examples\AVR31\Using_ActiveX\Outlook" folder.  Make sure you read all of the documentation that accompanies these examples.

TIP: MSDN Developer considerations regarding Outlook and Security

You can also use third party solutions to bypass security checking: Here's the easiest 3rd party solution to get around this Microsoft warning: http://www.contextmagic.com/express-clickyes/

More information and other 3rd party solutions: http://www.outlookcode.com/d/sec.htm

  • Third Party Email ActiveX Controls:

There are several third party controls that provide support for email.  These controls don't use the Outlook Object.

You can search for these components at: http://www.vbxtras.com.

TIP: We have used a SMTP Control by Software Artisans, available at: http://www.softwareartisans.com/softartisans/smtpmail.html.  AVR 3.5 includes an example that uses this SMTP Control by Software Artisans.

You will need to download and install this third party control prior to running this example.

  • Utilizing the Operating System's Default Email client:

You can also use AVR's OSEXEC command to send email, providing there is a email client installed.

Note: If this example doesn't work, your email client is not configured to send SMTP requests correctly.  Please coordinate with your Network Administrator to configure your email client.

Here is example code that demonstrates this:

// Reference material for the "MAILTO" functionality listed below:

// http://www.ianr.unl.edu/internet/mailto.html

// http://www.faqs.org/rfcs/rfc2368.html

dclconst spaces value("%20")

DCLFLD Mydate Type( *DATE ) TIMFMT( *ISO )
DCLFLD MyMailCommand Type( *STRING )

// Move the current date into our variable
TIME Target( MyDate )

// Build our Command Line
MyMailCommand = "mailto:test@test.com?subject=Current" + spaces + "date" ++
spaces + "is:" + spaces + %char(MyDate) + "&body=this" ++
spaces + "is" + spaces + "the" + spaces + "rest" + spaces ++
"of" + spaces + "the" + spaces + "text."

// This next line is commented out, but when uncommented is used to check exactly
// what is being passed to the OSEXEC command for debugging purposes
// msgbox MyMailCommand

OsExec CMDLINE( MyMailCommand )

Other ASNA KB Articles:

Other Misc. Information on Outlook Security:

Other Microsoft KB Articles (regarding Outlook):

Keywords: email, example, client, develop, IDE, SMTP, security, exchange, syntax, MailTo

Last Modified Date: 10/11/2005 2:37:15 PM

Copyright © 2005, 2006 ASNA Inc.

  Support Home   |   Search   |   Documentation