9.05.700B BPM Email

Thank you Brenda! It worked perfectly.

I am trying to get the BPM email code to work and not having much luck. Done a lot of searching here and got the answerbook help, but still no luck. Take a look to see if I have everything right. If so, then what services do I need to have turned on to let the email go? If not, please help.


Thanks in advance.



for each ttOrderHed


                where
ttOrderHed.RowMod = ‘U’ on error undo, next:                        


                define
variable vFrom as character no-undo initial ‘’:U.

                define
variable vTo as character no-undo initial ‘’:U.

                define
variable vCC as character no-undo initial ‘’:U.

                define
variable vSubject as character no-undo initial ‘’:U.

                define
variable vBody as character no-undo initial ‘’:U.

                define
variable hEmailEx as handle no-undo.

                run
Bpm/BpmEmail.p persistent set hEmailEx.

                define
variable vMsg as character no-undo initial ‘’:U.

                define
variable from_cnt as integer no-undo.

                define
variable to_cnt as integer no-undo.

                define
variable cc_cnt as integer no-undo.

                define
variable subject_cnt as integer no-undo.

               define
variable body_cnt as integer no-undo.


                 assign
vBody = ‘Hello’.

                assign
vSubject = ‘Monte Test’.

                assign
vFrom = me@…’.

                assign
vTo = me@…’.


                if
valid-handle(hEmailEx) then

                RUN
SendMail in hEmailEx (FALSE, CUR-COMP, vFrom, vTo, vCC, vSubject, vBody,
“”:U).


                {lib/PublishInfoMsg.i
&InfoMsg = vSubject}.


                 if
valid-handle(hEmailEx) then DELETE PROCEDURE hEmailEx.


                LEAVE.


 

end.

For what is worth there are a dozen or more threads on this specific topic in the forum. Search around a bit and you'll likely find your answer.


Jose C Gomez
Software Engineer



T: 904.469.1524 mobile

E: jose@...
http://www.josecgomez.com

     Â


Quis custodiet ipsos custodes?


On Tue, Aug 5, 2014 at 3:53 PM, mtisland@... [vantage] <vantage@yahoogroups.com> wrote:

Â
<div>
  
  
  <p></p><p><span></span></p><p>I am trying to get the BPM email code to work and not having much luck. Done a lot of searching here and got the answerbook help, but still no luck. Take a look to see if I have everything right. If so, then what services do I need to have turned on to let the email go? If not, please help.</p>


Thanks in advance.



for each ttOrderHed


               where
ttOrderHed.RowMod = 'U' on error undo, next:Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â


               define
variable vFrom as character no-undo initial '':U.

               define
variable vTo as character no-undo initial '':U.

               define
variable vCC as character no-undo initial '':U.

               define
variable vSubject as character no-undo initial '':U.

               define
variable vBody as character no-undo initial '':U.

               define
variable hEmailEx as handle no-undo.

               run
Bpm/BpmEmail.p persistent set hEmailEx.

               define
variable vMsg as character no-undo initial '':U.

               define
variable from_cnt as integer no-undo.

               define
variable to_cnt as integer no-undo.

               define
variable cc_cnt as integer no-undo.

               define
variable subject_cnt as integer no-undo.

              define
variable body_cnt as integer no-undo.


                assign
vBody = 'Hello'.

               assign
vSubject = 'Monte Test'.

               assign
vFrom = me@…'.

               assign
vTo = me@…'.


               if
valid-handle(hEmailEx) then

               RUN
SendMail in hEmailEx (FALSE, CUR-COMP, vFrom, vTo, vCC, vSubject, vBody,
"":U).


               {lib/PublishInfoMsg.i
&InfoMsg = vSubject}.


                if
valid-handle(hEmailEx) then DELETE PROCEDURE hEmailEx.


               LEAVE.


Â

end.

</div>
 


<div style="color:#fff;min-height:0;"></div>

Here is my template.  It is plug in ready.

 

DEFINE VARIABLE hEmailProc AS HANDLE NO-UNDO.

RUN Bpm/BpmEmail.p PERSISTENT SET hEmailProc.

DEFINE VARIABLE emailFrom AS CHARACTER INITIAL "email@removed" NO-UNDO.

DEFINE VARIABLE emailTo AS CHARACTER INITIAL "email@removed" NO-UNDO.

DEFINE VARIABLE CCTo AS CHARACTER INITIAL "" NO-UNDO.

DEFINE VARIABLE subject AS CHARACTER INITIAL "SUBJECT" NO-UNDO.

DEFINE VARIABLE emailBody AS CHARACTER INITIAL "EMAIL BODY" NO-UNDO.

 

emailTo = " email@removed ".

Subject = "My Subject".

emailBody = "Hello World".

 

RUN SendEmail IN hEmailProc (

false,                      /*Async*/

"10",                       /*Company*/

emailFrom,           /*Email From*/

emailTo,                /*Email To*/

CCTo,                    /* CC*/

subject, /*Subject*/

emailBody,           /*Text*/

''                               /*MIME Type*/

).

 

IF VALID-HANDLE(hEmailProc) THEN DELETE PROCEDURE hEmailProc NO-ERROR.

 

 

Brenda

 

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Tuesday, August 05, 2014 3:53 PM
To: vantage@yahoogroups.com
Subject: [Vantage] 9.05.700B BPM Email

 

 

I am trying to get the BPM email code to work and not having much luck. Done a lot of searching here and got the answerbook help, but still no luck. Take a look to see if I have everything right. If so, then what services do I need to have turned on to let the email go? If not, please help.

 

Thanks in advance.

 

 

for each ttOrderHed

 

                where ttOrderHed.RowMod = 'U' on error undo, next:                        

 

                define variable vFrom as character no-undo initial '':U.

                define variable vTo as character no-undo initial '':U.

                define variable vCC as character no-undo initial '':U.

                define variable vSubject as character no-undo initial '':U.

                define variable vBody as character no-undo initial '':U.

                define variable hEmailEx as handle no-undo.

                run Bpm/BpmEmail.p persistent set hEmailEx.

                define variable vMsg as character no-undo initial '':U.

                define variable from_cnt as integer no-undo.

                define variable to_cnt as integer no-undo.

                define variable cc_cnt as integer no-undo.

                define variable subject_cnt as integer no-undo.

               define variable body_cnt as integer no-undo.

 

                 assign vBody = 'Hello'.

                assign vSubject = 'Monte Test'.

                assign vFrom = me@...'.

                assign vTo = me@...'.

 

                if valid-handle(hEmailEx) then

                RUN SendMail in hEmailEx (FALSE, CUR-COMP, vFrom, vTo, vCC, vSubject, vBody, "":U).

 

                {lib/PublishInfoMsg.i &InfoMsg = vSubject}.

 

                 if valid-handle(hEmailEx) then DELETE PROCEDURE hEmailEx.

 

                LEAVE.

 

 

end.