来自 iSeries 的带有附件的邮件
有没有办法从 iSeries 终端发送电子邮件,并从 IFS 添加附件? 我知道如何使用 SNDDST 实用程序发送普通电子邮件。
Is there a way to send an email from an iSeries terminal, adding an attachment from the IFS? I know how to send a normal email using the SNDDST utility.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
有两种主要方法可以做到这一点。
There is two main methods of doing this.
最新版本的操作系统附带 SNDSMTPEMM 命令已包含在内。 它非常易于使用,只需填充适当的参数即可包含邮件正文和附件。
这就是我向系统上拥有它并且需要简单且免费的东西的人推荐的。 为了更加稳健,有 Brad Stone 的 MAILTOOL Plus,它是可作为付费订阅。
以下信息是我的原始答案,略有更新,主要用于历史目的:
在我工作的地方,我们使用 MMAIL。 它成本低廉,并提供易于使用的命令。 例如,我总是按如下方式通过电子邮件发送流文件(在 CLP 内):
还有其他可用参数(如果使用交互式提示符,则非常不言自明),以及其他几个命令来处理最常见的情况。常见用例。 如果您想要更精细的控制,或者需要发送更复杂的消息,该包还提供了一个 API,但我从来不需要比提供的命令更多的命令。
该实用程序曾经是免费的,但作者现在需要“捐赠”50 美元才能完全访问其网站的下载。
Recent versions of the operating system come with the SNDSMTPEMM command already included. It's quite easy to use and allows you to include both a message body and an attachment simply by populating the appropriate parameters.
That is what I would recommend for anyone who has it on their system, and needs something simple and free. For more robustness, there is Brad Stone's MAILTOOL Plus, which is available as a paid subscription.
The below information is my original answer, slightly updated, mainly for historical purposes:
Where I work we use MMAIL. It's low-cost and provides easy-to-use commands. For example, I happen to e-mail stream files all the time as follows (within a CLP):
There are other parameters available as well (pretty self-explanatory if you use the interactive prompt), and several other commands to handle the most common use cases. The package does also provide an API if you want finer control, or need to send much more complex messages, but I have never needed more than the provided commands.
This utility used to be free, but the author now requires a "donation" of $50 for full access to downloads from his site.
您可以使用 Java 和 JavaMail API 编写自己的程序。
You could code your own program with Java and the JavaMail API.
我有一段时间没看过了,但 i5/OS 上应该有一些 QSH 可以使用的 unixy 邮件实用程序。 如果没有,那么移植一个应该是一件简单的事情。 在这里寻找想法:http://www.shelldorado.com/articles/mailattachments.html
但我更喜欢 JavaMail 的想法。 只需快速谷歌一下即可找到一个包含 JavaMail 使用示例的网站: http://www.javaworld.com/javaworld/jw-10-2001/jw-1026-javamail.html
使用 JavaMail,您还可以阅读邮件(如果也可以)有用。
更新:您说您已经可以从 IFS 添加附件。 命令 CATSPLF (QSH 实用程序的一部分)可以检索假脱机文件并将其写入标准输出。 这意味着您可以将假脱机文件传输到 IFS。 但你必须对创造他们的工作有很多了解。
喜欢:
I found this at http://www.mcpressonline.com/tips-techniques/cl/techtip-read-printer-output-with-qshell.html.
CATSPLF was introduced in V5R3.
I have not looked in a while but there should be some unixy mail utilities on i5/OS that QSH could use. If not, it's supposedly a simple matter to port one. Look here for ideas: http://www.shelldorado.com/articles/mailattachments.html
But I like the JavaMail idea better. Just a quick google yields a site that has examples of JavaMail usage: http://www.javaworld.com/javaworld/jw-10-2001/jw-1026-javamail.html
With JavaMail you can also read mail if that could also be useful.
Update: You say you can already add attachments from the IFS. The command CATSPLF (part of QSH utilities) can retrieve spool files and write them to standard output. Which means you can transfer spool files to the IFS. But you have to know a lot about the job that created them.
Like:
I found this at http://www.mcpressonline.com/tips-techniques/cl/techtip-read-printer-output-with-qshell.html.
CATSPLF was introduced in V5R3.