Sending out Emails using Progress Code

You have two options. A BPM or BAM. BPM Code would look something like this:

for each ttinventoryqtyadj no-lock.
find PartCost where PartCost.Company = ttinventoryqtyadj. Company and PartCost.PartNum = ttinventoryqtyadj. PartNum and PartCost.CostID = '1' no-lock.
if ABSOLUTE(ttinventor yqtyadj.AdjustQu antity * PartCost.StdMateria lCost) > 1000 then do:
repeat:
define variable mFrom as character no-undo initial 'xyz@mycompany. com':U.
define variable mTo as character no-undo initial 'abc@mycompany. com':U.
define variable mCc as character no-undo initial 'def@mycompany. com':U.
define variable mSubject as character no-undo initial 'Inv Adjust Variance Value Exceeded':U.
define variable mBody as character no-undo initial '':U.
define variable mhEmailProc as handle no-undo.
run Bpm/BpmEmail. p persistent set mhEmailProc.
assign mBody = mBody + 'Part Number ' + string(ttinventoryq tyadj.PartNum) .
assign mBody = mBody + ' ' + ttinventoryqtyadj. PartPartDescript ion.
assign mBody = mBody + '~n'.
assign mBody = mBody + 'Adjusted by ' + string(DCD-USERID) .
assign mBody = mBody + '~n'.
assign mBody = mBody + ' has a variance value of $' + string((ttinventory qtyadj.AdjustQua ntity * PartCost.StdMateria lCost),"> >>,>>>,>> 9.99").

run SendEmail in mhEmailProc (
false,
CUR-COMP,
mFrom,
mTo,
mCc,
mSubject,
mBody,
"":U
).

if valid-handle( mhEmailProc) then delete procedure mhEmailProc.
leave.
end.
end.
end.

You could also do a BAM and use the "Send Alert" with an attached Alert Program. Lookup GlbAlert.i in the Vantage help file for the list of parameter variable available within the GlbAlert.i file.


________________________________
From: Robert <robert.nupp@...>
To: vantage@yahoogroups.com
Sent: Wed, March 17, 2010 1:57:15 PM
Subject: [Vantage] Sending out Emails using Progress Code

Â
I am looking for a way to create and send emails using progress code. has anyone ever done and if so would you be willing to share some code? Thanks

Robert








[Non-text portions of this message have been removed]
I am fairly good with writing Progress Code and I would like to be able to automate a process using progress code that would send emails. I have looked online and haven't come up with much luck on how to do this. Can anyone give me some insight on how to send emails through smtp via progress code? Thanks

Robert
I am looking for a way to create and send emails using progress code. has anyone ever done and if so would you be willing to share some code? Thanks

Robert
Look at message 88571 from yestedary.

--- In vantage@yahoogroups.com, "Robert" <robert.nupp@...> wrote:
>
> I am looking for a way to create and send emails using progress code. has anyone ever done and if so would you be willing to share some code? Thanks
>
> Robert
>
I use the MSWinsock.OCX control (the basics):

chCtrlFrame:Winsock:Protocol = 0.
chCtrlFrame:Winsock:RemoteHost = IP Address.
chCtrlFrame:Winsock:RemotePort = 25.
chCtrlFrame:Winsock:Connect.
chCtrlFrame:Winsock:SendData ("HELO servername" + CHR(13) + CHR(10)).
chCtrlFrame:Winsock:SendData ("mail from: " + FromAddress + CHR(13) +
CHR(10)).
chCtrlFrame:Winsock:SendData ("rcpt to: " + ToAddress + CHR(13) +
CHR(10)).
chCtrlFrame:Winsock:SendData ("data" + CHR(13) + CHR(10)).
chCtrlFrame:Winsock:SendData ("From: " + FromID + CHR(13) + CHR(10) +
MessageDate + "X-Mailer: EBT Reporter v 2.x" + CHR(13) + CHR(10) + "To:
" + ToNames + CHR(13) + CHR(10) + "Subject: " + subject + CHR(13) +
CHR(10) + CHR(13) + CHR(10)).
chCtrlFrame:Winsock:SendData (message text + CHR(13) + CHR(10) + CHR(13)
+ CHR(10)).
chCtrlFrame:Winsock:SendData ("." + CHR(13) + CHR(10)).
chCtrlFrame:Winsock:SendData ("quit" + CHR(13) + CHR(10)).






Michael Podlin
Network Administrator

V-S Industries, Inc.
900 S. Chaddick Dr.
Wheeling, IL 60090
847-520-1800 x207
Fax 847-520-0269
Michael.Podlin@...




Please consider the environment.
Do you really need to print this email?
________________________________

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Robert
Sent: Wednesday, March 17, 2010 12:37 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Sending out Emails using Progress Code




I am fairly good with writing Progress Code and I would like to be able
to automate a process using progress code that would send emails. I have
looked online and haven't come up with much luck on how to do this. Can
anyone give me some insight on how to send emails through smtp via
progress code? Thanks

Robert








[Non-text portions of this message have been removed]