Wednesday, May 21, 2014

Tip of The Day: Sending E-Mail Through MS Outlook With R:BASE MAPIMail Plugins
Product.: R:BASE eXtreme 9.5 (32/64)
Build...: 9.5.4.30430 or higher www.rupdates.com
Keywords: E-Mail, PLUGIN, MAPIMail
Section.: Plugins

When working with the R:BASE MAPIMail Plugins to send E-Mail using MS Outlook, several additional parameter options are available to ensure the message is sent or is displayed
appropriately.

The following are the standard email parameters with the MapiMail3 Plugin:

TO:          - the message recipient(s)
CC:          - the carbon copy recipient(s)
BCC:         - the blind carbon copy recipient(s)
SUBJECT:     - the message subject
BODY:        - the message body content
ATTACHMENTS: - the file attachment(s)

The following are the email client parameters (MS Outlook) with the MapiMail3 Plugin:

PROFILE_NAME: - email profile to be used by the Messaging API when the Send method is called. Typically, this parameter is left blank which instructs MAPI to use the default profile.
PASSWORD:                - the email profile password for the login process
RESOLVE_NAMES: - resolves a message recipient's name (as entered by a user) to an unambiguous address list entry, optionally prompting the user to choose between possible alternative entries, if
                           necessary. (TRUE/FALSE)
SUPPRESSOUTLOOKSECURITY: - suppresses the MS Outlook security warning (TRUE/FALSE)

The following example demonstrates the use of all parameters with several email
recipients:

-- MapiMail3_Outlook_With_Attachments.RMD
-- May 21, 2014
   CLEAR ALL VARIABLES
   -- Pre-Define All Variables with Correct Data Type
   SET VAR vQuote TEXT = NULL
   SET VAR vEMail TEXT = NULL
   SET VAR vPipe TEXT = NULL
   SET VAR vCRLF TEXT = NULL
   SET VAR vTo TEXT = NULL
   SET VAR vSubject TEXT = NULL
   SET VAR vCc TEXT = NULL
   SET VAR vBcc TEXT = NULL
   SET VAR vBody TEXT = NULL
   SET VAR vAttachments TEXT = NULL
   SET VAR vFileSpec TEXT = NULL
   SET VAR vToRecipient1 TEXT = NULL
   SET VAR vToRecipient2 TEXT = NULL
   SET VAR vCCRecipient1 TEXT = NULL
   SET VAR vCCRecipient2 TEXT = NULL
   SET VAR vBCCRecipient1 TEXT = NULL
   SET VAR vBCCRecipient2 TEXT = NULL
   SET VAR vToRecipientList TEXT = NULL
   SET VAR vCCRecipientList TEXT = NULL
   SET VAR vBCCRecipientList TEXT = NULL
   SET VAR vResolveNames TEXT = NULL
   SET VAR vSuppressSecurity TEXT = NULL
   SET VAR vParameters TEXT = NULL
   -- Assign Values
   SET VAR vQuote = (CVAL('QUOTES'))
   SET VAR vEMail = 'vEMail'
   SET VAR vPipe = '|'
   SET VAR vCRLF = ((CHAR(13))+(CHAR(10)))
   SET VAR vToRecipient1 = '[email protected]'
   SET VAR vToRecipient2 = '[email protected]'
   SET VAR vToRecipient3 = '[email protected]'
   SET VAR vCCRecipient1 = '[email protected]'
   SET VAR vCCRecipient2 = '[email protected]'
   SET VAR vBCCRecipient1 = '[email protected]'
   SET VAR vBCCRecipient2 = '[email protected]'
   SET VAR vToRecipientList = +
      (.vToRecipient1 + vCRLF + .vToRecipient2 + .vCRLF + .vToRecipient3)
   SET VAR vCCRecipientList = +
      (.vCCRecipient1 + vCRLF + .vCCRecipient2)
   SET VAR vBCCRecipientList = +
      (.vBCCRecipient1 + vCRLF + .vBCCRecipient2)
   SET VAR vFileSpec =  +
      'C:\Reports\InspectionReport_RBTI_Roasters_22912_20140521.pdf'
   SET VAR vTo = ('TO:' + .vToRecipientList)
   SET VAR vSubject = ('SUBJECT: Inspection Report Results')
   SET VAR vCc = ('CC:' + .vCCRecipientList)
   SET VAR vBcc = ('BCC:' + .vBCCRecipientList)
   SET VAR vBody = ('BODY: Please review the attached Inspection Report.')
   SET VAR vAttachments = ('ATTACHMENTS:' + .vFileSpec)
   SET VAR vResolveNames = ('RESOLVE_NAMES:TRUE')
   SET VAR vSuppressSecurity = ('SUPPRESSOUTLOOKSECURITY:TRUE')
   SET VAR vParameters = +
   (.vQuote+.vEMail&.vPipe+.vTo&.vPipe+.vSubject&.vPipe+.vCc&.vPipe+ +
    .vBcc&.vpipe+.vBody&+.vPipe+.vAttachments&.vPipe+.vResolveNames& +
    .vPipe+.vSuppressSecurity+.vQuote)
   PLUGIN MapiMail3 &vParameters
   CLEAR VARIABLES vQuote,vEMail,vPipe,vCRLF,vTo,vSubject,vCc,vBcc, +
   vBody,vAttachments,vFileSpec,vToRecipient1,vToRecipient2, +
   vToRecipient3,vCCRecipient1,vCCRecipient2,vBCCRecipient1, +
   vBCCRecipient2,vToRecipientList,vCCRecipientList, +
   vBCCRecipientList,vSuppressSecurity,vResolveNames,vParameters
   RETURN

Now you can automate the tasks of sending email messages to multiple
recipients with attachments.

Have fun!

Very Best R:egards,

Razzak.

www.rbase.com
www.facebook.com/rbase
--
31 years of continuous innovation!
16 Years of R:BASE Technologies, Inc. making R:BASE what it is today!
--


Reply via email to