I've had several requests for the code, so I'll just include it here..
 
I cut out alot of code that didn't have anything to do with auto email part.
 
Any questions please feel free to ask...
 
Buddy
 
**************Code starts here
   CLE ALL VAR

   SET VAR VCode INTEGER
   SET VAR VCode1 INTEGER

   SET VAR VLoop = 1
   SET VAR VWhatPart TEXT
   SET VAR VPart1 TEXT
   SET VAR VPart2 TEXT
   SET VAR VPart3 TEXT
   SET VAR VPart4 TEXT
   SET VAR VPart5 TEXT
   SET VAR VPart6 TEXT
   SET VAR VPart7 TEXT
   SET VAR VPart8 TEXT
   SET VAR VPart9 TEXT
   SET VAR VPart10 TEXT
   SET VAR VRowID INTEGER
   SET VAR VEMail TEXT
   SET VAR VCR = (CHAR(13))
   SET VAR VFileName TEXT
   SET VAR VWhatRow INTEGER = 1
   SET VAR VMod INTEGER
   SET VAR VFullName TEXT
   SET VAR VUserName TEXT

   Declare CURSOR ................
   OPEN C#1
   FETCH C#1 INTO .....
 
   WHILE SQLCODE <> 100 THEN

   --Some other code here

   SET VAR VFileName = (FILENAME(0))
--Gets the file name without the $$$ extensions
   SET VAR VFileName = (SGET(.VFileName,8,(SLEN(.VFileName))-11))
-- Put the file in a restricted folder on the exchange
-- I'm using a program called Tech Sechduler for NT which basically checks this folder every 15 min
-- for any files with the TXT extension (or any extension you want) and then moves any files from
-- here to the actual pickup folder of exchange.
--You can put the files directly in the pickup but I didn't want everyone having access to that directory.

   SET VAR VFileName = ('\\ExchangeServerName\' +.VFileName +'.TXT')

   SEL (FSTNAME & LSTNAME) INTO VFullName INDIC IVFullName FROM +
    Applicant WHE UserName = .VUserName

--The From, To, Subject must be written as is, also the VCR (Carriage return must be there)

   OUT &VFileName
 
    WRI 'From:
[EMAIL PROTECTED]'
    WRI 'To:' .VEMail
    WRI 'Subject: Recommendation for' .VFullName
    WRI .VCR

    WRI .VFullName 'has request that you complete an online recommendation.'
    WRI 'Say whatever you want here'
    WRI ' '
    WRI '     Access Code =' .VNewPass
    WRI ' '
    WRI '  The above access code cannot be used for anyone other than' .VFullName
    WRI ' '
    WRI '  Should you have questions or concerns, please send an email to
[EMAIL PROTECTED]'
   OUT TERM

LABEL NxtOne

   SET VAR VWhatRow = (.VWhatRow + 1)
   SET VAR VCode = 0
   SET VAR VCode1 = 0
 
   SET VAR VNewPass = NULL
   SET VAR VLoop = 1
 
   FETCH C#1 INTO VRowID INDIC IVRowID,VEMail INDIC IVEMail,VUserName INDIC IVUserName
ENDWHILE

    DROP CURSOR C#1

    CLE VAR VPart1,VPart2,VPart3,VPart4,VPart5,VPart6,VPart7,VPart8,VPart9,VPart10
    CLE VAR VLoop,VCode,VCode1,VWhatPart

   RETURN

*************Code ends here
 
 
 
-----Original Message-----
From: Bernard Lis [mailto:[EMAIL PROTECTED]]
Sent: Sunday, September 02, 2001 4:39 PM
To: [EMAIL PROTECTED]
Subject: Re: Automating Email

I'd like to see the code, if it can send automatically, maybe I can switch my customer to using Exchange instead of Outlook.
 
Please send it to:  [EMAIL PROTECTED]
 
Thanks,
Bernie Lis

Reply via email to