Re: How to run the mailx command in 4GL
Posted in 2010
Topics: Stored Procedures & SPL, Connectivity: ESQL/C, 4GL & Embedded SQL
I user a table to hold email addresses. I user a report to gen the output file that will become the body of the mail message. The DISPLAY is for information only. #------------------------------------------------------------------------------ FUNCTION send_daemon_mail() #------------------------------------------------------------------------------ FOREACH select_mail_curs INTO t_email_add LET x_txt = "mailx -s\\\\"MQ error on ", t_server CLIPPED, "\\\\" < /tmp/mq_mail_error.dat ", t_email_add CLIPPED DISPLAY "185 - [", x_txt CLIPPED, "]" RUN x_txt END FOREACH END FUNCTION
Thanks Ralph and all, Eventually I have managed to sucessfully run mailx inside 4GL as follows: main let mv_subject = "Person 33048 status changed to discordant" let mv_recipients = "lnguyen@addr1", " ctolentino@arrd2" let mv_text = "By ", usr.initials clipped, " - ", usr.security clipped, " On ", today using "dd/mm/yyyy" call send_email(mv_subject,mv_recipients, mv_text) end main FUNCTION send_email(lv_subject,lv_recipients,lv_text) define lv_subject char(200), lv_recipients char(500), lv_text char(200), lv_send_str char(1000) let lv_send_str = "\\\\"",lv_subject clipped,"\\\\"", " \\\\"", lv_recipients clipped,"\\\\"" let lv_send_str = "echo \\\\"",lv_text clipped, "\\\\"", " | mailx -s ",lv_send_str clipped run lv_send_str clipped END FUNCTION Regards, Long N. --- On Mon, 16/8/10, RALPH GENTRY <gentrym@staples.com> wrote: From: RALPH GENTRY <gentrym@staples.com> Subject: Re: How to run the mailx command in 4GL [20935] To: ids@iiug.org Received: Monday, 16 August, 2010, 10:24 PM I user a table to hold email addresses. I user a report to gen the output file that will become the body of the mail message. The DISPLAY is for information only. #------------------------------------------------------------------------------ FUNCTION send_daemon_mail() #------------------------------------------------------------------------------ FOREACH select_mail_curs INTO t_email_add LET x_txt = "mailx -s\\\\"MQ error on ", t_server CLIPPED, "\\\\" < /tmp/mq_mail_error.dat ", t_email_add CLIPPED DISPLAY "185 - [", x_txt CLIPPED, "]" RUN x_txt END FOREACH END FUNCTION ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum.