Mail return status

<< Click to Display Table of Contents >>

Navigation:  How to >

Mail return status

Available with vpxPrint version 10.7b:

Mail status can be checked with the entry point getMailResult in xprint.dll:

DEF VAR i AS INT.

 

RUN getMailResult(OUTPUT i).

 

Return value is a merge of the following values:

1                Mail is sent

10                Mail error

100                Mail is saved                        // Applies to Outlook, no support for MAPI

1000                Mail attachment error

10000                Outlook

100000                CDO

1000000        MAPI

 

PROGRESS users will have an easier way to check the return code. A new function mailStatus() is defined in xprint.i:

Syntax:

<logical>    =   mailStatus( <Condition_to_check> ).

 

where <Condition_to_check> is one of:

mailSent                                1

mailError                        2

mailSave                        3

mailAttachError                        4

mailOutlook                        5

mailCDO                        6

mailMAPI                        7

(All of these values are defined in xprint.i include file)

 

Example:

RUN printFile( "c:/temp/myReport.xpr").        /* no need to call printFileStat() */

 

IF mailStatus( MailSent ) THEN

         MESSAGE "Mail is sent" VIEW-AS ALERT-BOX.

 

 

 

 

-- OR --

 

DEF VAR a AS CHAR NO-UNDO.

 

IF MailStatus(MailSent) THEN

           A = 'Sent '.

IF MailStatus(MailSave) THEN

           A = A + 'Save '.

IF MailStatus(MailError) THEN

           A = A + 'ERROR '.

IF MailStatus(MailAttachError) THEN

           A = A + 'AttachERROR '.

IF MailStatus(MailOutlook) THEN

           A =  A + 'Outlook '.

IF MailStatus(MailCDO) THEN

           A =  A + 'CDO '.

IF MailStatus(MailMAPI) THEN

           A =  A + 'MAPI '.

 

MESSAGE "Done." SKIP(1)

          /* 'Mail Return code:' J   SKIP(2) */        /* NOT NEEDED */

          'Mail status:' A

          VIEW-AS ALERT-BOX.