is Mail_files is a function?

a 夏天 提交于 2020-01-06 05:03:34

问题


DEFINE VARIABLE wlc-Identifiant AS CHARACTER   NO-UNDO.
DEFINE VARIABLE wlc-file-txt    AS CHARACTER   NO-UNDO.

wlc-Identifiant = STRING(YEAR(TODAY), "9999") + STRING(MONTH(TODAY), "99") + STRING(DAY(TODAY), "99") + REPLACE(STRING(TIME, "HH:MM:SS"), ":", "").
wlc-file-txt = wlc-Identifiant + "foo.txt".

DEFINE STREAM outStr.
OUTPUT STREAM outStr TO VALUE (wlc-file-txt).

FOR EACH customer NO-LOCK:
  EXPORT STREAM outStr customer.
END.
OUTPUT STREAM outStr CLOSE.

RUN sendmail.p (INPUT wlc-file-txt). /* add the file in parameter */

/*OS-DELETE foo.txt.*/ /* It 's a cron job */

Sendmail.p
DEFINE INPUT  PARAMETER wlpic-file-txt AS CHARACTER   NO-UNDO.
DEFINE STREAM stMail.
OUTPUT STREAM stMail THROUGH
   "mail_files -f foo@bar.com -t me@here.com -s\"subject\" -b~\" + wlpic-file-txt + "\").
PUT STREAM stMail "Email body".
OUTPUT STREAM stMail CLOSE.

回答1:


In this case mail_files appears to be an external UNIX command. Probably a script.

You might get very similar functionality using mailx which is available on pretty much every UNIX system.

If -f is supposed to be "From" in the mail_files script then -f probably becomes -r

Likewise if -t is supposed to be "to" it just gets eliminated, mailx assumes an unadorned argument is the "to" address. Mailx will use any text on standard input as the body. So instead of -b you would just write to the stream (the 'PUT STREAM stMail "Email body".' command that you see.) You can attach a file with mailx using -a.




回答2:


No, I think it's a command line of Thunderbird.
I found this this morning.



来源:https://stackoverflow.com/questions/24083831/is-mail-files-is-a-function

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!