Hello all,
Whats the best way to send an email out using Progress?
I've looked at using several different methods but none of them seem to work:
DOS SILENT VALUE('blat '...).
OUTPUT STREAM s-strm THROUGH VALUE('elm...).
OUTPUT STREAM s-strm THROUGH VALUE('mutt...).
These all cause a command window to pop-up quickly and then disappear but no email is sent. Anyone have some insight?
Thanks,
Kadrin
Update - It seems that my local session doesn't have access to our email server. Thus, it won't work locally.
If your e-mail server supports SMTP, go here http://freeframework.sourceforge.net/downloads/accepted/ for smtpmail.p
Hi Kadrin,
here I've pasted the code to send email to outlook, you can modify as per your req..
and hope it might help.
DEFINE VARIABLE liSize AS INTEGER NO-UNDO INIT 255.
DEFINE VARIABLE lmUserId AS MEMPTR NO-UNDO.
DEFINE VARIABLE lcUserId AS CHARACTER NO-UNDO.
DEFINE VARIABLE cPassword AS CHARACTER NO-UNDO.
DEFINE VARIABLE gcWinTitle AS CHARACTER NO-UNDO.
DEFINE VARIABLE objOutlook AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE objOutlookMsg AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE objOutlookAttach AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE objOutlookRecip AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE opFile AS CHARACTER NO-UNDO.
DEFINE STREAM opStrm.
opFile = "Hi" + STRING(MONTH(TODAY)) + STRING(DAY(TODAY)) + STRING(YEAR(TODAY)) + ".txt".
OUTPUT STREAM opStrm TO VALUE(opFile).
/*vvvvv-------------------------- GetUserNameA(Procedure)-STARS------------------------vvvvv*/
DO ON ERROR UNDO, LEAVE:
SET-SIZE(lmUserId) = liSize + 1.
RUN GetUserNameA(INPUT-OUTPUT lmUserId,
INPUT-OUTPUT liSize) NO-ERROR.
ASSIGN lcUserId = GET-STRING(lmUserId, 1).
END.
/* display lcUserID. */
PROCEDURE GetUserNameA EXTERNAL "advapi32.dll":
DEFINE INPUT-OUTPUT PARAMETER iopcuser AS MEMPTR.
DEFINE INPUT-OUTPUT PARAMETER iopilength AS LONG.
END PROCEDURE.
/*^^^^^--------------------------- GetUserNameA(Procedure)-ENDS----------------------^^^^^*/
/*vvvvv------------------- Creating MicroSoft OutLook Express to send mail-STARS-----vvvvv*/
CREATE "Outlook.Application" objOutlook.
objoutlookMsg = objOutlook:CreateItem(0).
objOutlookRecip = objOutlookMsg:Recipients:Add("mail.psdn.com").
objOutlookRecip:Type = 1.
objOutlookMsg:Subject = opFile + "-Hi mail".
objOutlookMsg:Body = "Hello, Good Morning...".
objOutlookMsg:To = lcUserID.
objOutlookMsg:Attachments:Add(opFile).
objOutlookRecip:Resolve.
objOutlookMsg:Send.
objoutlook:Quit().
RELEASE OBJECT objOutlook.
RELEASE OBJECT objOutlookMsg.
RELEASE OBJECT objOutlookRecip.
/*^^^^^------------------- Creating MicroSoft OutLook Express to send mail-ENDS-----^^^^^*/
OUTPUT STREAM opStrm CLOSE.
Given the OP's reference to Elm, I doubt they are interested in Outlook, but this would make a good page on OE Hive.