Oma: Thanks for the response. The reason that the |EMAIL_TO_LIST .v2 would not work with a variable in the original file I posted was that quotes were added to the variable (actually, any variable) when the e-mail file was sent to the destination server. Razzak's concatenated solution was the answer, but getting all the quotes and ampersands correct in such a long string was somewhat of a challenge. See the relevant portions of the file below for reference. Variable v1 is defined earlier through the DIALOG command. Also for anyone else interested, it appears that there is no need to add .pdf to the FILENAME c:\export\'&.vresponce as apparently the OPTION PDF adds the extension automatically, and the '|EMAIL_ATTACHMENTS' section seems to work without specifying a filename, at least when only one attachment is to be included.

Regards

Steve



                 ELSE
SET VARIABLE V1 TEXT = ID1 IN TRANS WHERE INVNO = .VRESPONCE SET VARIABLE V2 TEXT = EMAIL IN CUSTOMER WHERE ID1 =.V1
                        Set VARIABLE V5 TEXT = Body text message

SET VAR vCommand TEXT = +
('PRINT INVOICE WHERE INVNO eq .vresponce OPTION PDF|FILENAME c:\export\'&.vresponce + +
'|EMAIL ON' + +
'|EMAIL_HOST'&'[email protected]' + +
'|EMAIL_USERID [email protected]' + +
'|EMAIL_PASSWORD xxxxxx' + +
'|EMAIL_TO_LIST'&.v2 + +
'|EMAIL_FROM_NAME'&'yourname' + +
'|EMAIL_FROM_ADDRESS'&'[email protected]' + +
'|EMAIL_SUBJECT invoice' + +
'|EMAIL_BODY'&.v5 + +
'|EMAIL_ATTACHMENTS' + +
'|EMAIL_PORT 25' + +
'|EMAIL_AUTHENTICATION ON' + +
'|EMAIL_DELETE_AFTER_SEND off' + +
'|EMAIL_SHOW_DIALOG OFF')
 &vCommand
 CLEAR VAR RNOTE1 RDATE1 VMESSAGE VKEY VENDKEY VRESPONCE v1 v1 v5 VCOMMAND
 RETURN

At 08:46 PM 1/16/2009, you wrote:
Steve,
SET VARIABLE VFILENAME = 'TEST.PDF'
SET VARIABLE V1 TEXT = ID1 IN TRANS WHERE INVNO = .VRESPONCE
SET VARIABLE V2 TEXT = EMAIL IN CUSTOMER WHERE ID1 =.V1
SET VARIABLE VRESPONCE = ('c:\EXPORT\'+.VFILENAME)

PRINT RENEW03 WHERE INVNO = .VRESPONCE +
   OPTION PDF|FILENAME .vresponce +
    |EMAIL ON +
    |EMAIL_HOST [email protected] +
    |EMAIL_USERID [email protected] +
    |EMAIL_PASSWORD xxxx+
    |EMAIL_TO_LIST  .v2 +
    |EMAIL_FROM_NAME example +
    |EMAIL_FROM_ADDRESS [email protected] +
    |EMAIL_SUBJECT test +
    |EMAIL_BODY (message and .RDATE1) +
    |EMAIL_ATTACHMENTS .vresponce +
    |EMAIL_PORT 25 +
    |EMAIL_AUTHENTICATION ON +
    |EMAIL_DELETE_AFTER_SEND off +
    |EMAIL_SHOW_DIALOG OFF
RETURN

Best Regards,


Oma Cox
O.C. Services Inc.
P.O. Box 5485
Brandon, MS 39047

662.820.7599
601.992.6785

www.ocservicesinc.com

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Steve
Johnson
Sent: Friday, January 16, 2009 6:46 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Re: E-mail 7.6

To All:

        I have been experimenting with the e-mail capability of Rbase 7.6
but have run into a few problems.  The biggest is whether one can
pass a variable to the |EMAIL_TO_LIST parameter (to pass an e-mail
address from the database). I placed a dotted variable in place of a
hardcoded name, defining the variable earlier that is captured when I
SHO VAR, but the e-mail process fails.  A hardcoded email address in
|EMAIL_TO_LIST does allow the e-mail process to be
successful.  However, in the received e-mail, curiously, there are
two attachments, rather than one as listed |EMAIL_ATTACHMENTS
C:\export\.vresponce.pdf. Also curious is that the .pdf extension
shown in the email is lower case in one and upper case in the
other.  I also have a variable (rdate1) in the message section that
is passed through successfully, but in the received e-mail, it has
single quotes around the printed variable. I suppose this may be
related to the set quotes command.
        So how do I pass a variable to the  |EMAIL_TO_LIST and why two
attachments rather than one.

R:Thanks
Steve

SET VARIABLE V1 TEXT = ID1 IN TRANS WHERE INVNO = .VRESPONCE
SET VARIABLE V2 TEXT = EMAIL IN CUSTOMER WHERE ID1 =.V1
PRINT RENEW03 WHERE INVNO = .VRESPONCE +
   OPTION PDF|FILENAME c:\export\.vresponce +
    |EMAIL ON +
    |EMAIL_HOST [email protected] +
    |EMAIL_USERID [email protected] +
    |EMAIL_PASSWORD xxxx+
    |EMAIL_TO_LIST  .v2 +
    |EMAIL_FROM_NAME example +
    |EMAIL_FROM_ADDRESS [email protected] +
    |EMAIL_SUBJECT test +
    |EMAIL_BODY (message and .RDATE1) +
    |EMAIL_ATTACHMENTS C:\export\.vresponce.pdf +
    |EMAIL_PORT 25 +
    |EMAIL_AUTHENTICATION ON +
    |EMAIL_DELETE_AFTER_SEND off +
    |EMAIL_SHOW_DIALOG OFF
RETURN


Reply via email to