是Mail_files是函数吗? [英] is Mail_files is a function?

查看:74
本文介绍了是Mail_files是函数吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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.

推荐答案

在这种情况下,mail_files似乎是一个外部UNIX命令.可能是脚本.

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

使用mailx可能会获得非常相似的功能,几乎每个UNIX系统都可以使用该功能.

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

如果-f在mail_files脚本中应该是发件人",那么-f可能会变成-r

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

同样,如果应该将-t设为至",它将被删除,mailx会假定一个未经修饰的参数是至"地址. Mailx将使用标准输入上的任何文本作为正文.因此,您无需写入-b,而是直接写入流中(您会看到"PUT STREAM stMail电子邮件主体".命令.)您可以使用-a将文件附加到mailx.

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.

这篇关于是Mail_files是函数吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆