如何使用邮件命令将文件内容嵌入电子邮件的正文中?

发布于 2025-01-27 05:53:32 字数 55 浏览 4 评论 0原文

我有需要,需要将文件内容作为邮件正文发送。我们可以通过Unix脚本点点。

提前致谢

I have requirement,where i need to send file content as mail body.can we dot through unix scripting.

Thanks in Advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

负佳期 2025-02-03 05:53:33

使用数据创建一个HTML文件。然后以电子邮件作为内容发送该文件。

使用表达式这样创建您的文件数据 -

v_data= '  <tr>
    <td>'||company ||'</td>
    <td>'|| contact_person|| '</td>
    <td>'|| country ||'</td>
  </tr>'

使用聚合器将所有这些数据限制为一行。团体无。

然后使用另一个表达式转换。
创建这样的端口 -

v_head ='
<head></head>
<body>

<b>pls find below data.</b>
<table>
  <tr>
    <th>Company</th>
    <th>Contact</th>
    <th>Country</th>
  </tr>'

v_body = Aggregated_v_data

v_tail='</table></body>'

v_output = v_head||v_body ||v_tail

然后使用此输出并连接到平面文件目标。

然后发送此平面文件Sing MailX命令/任何邮件客户端。

输出应该看起来像这样。

HTML文件应该看起来像这样

<head></head>
<body>

pls find below data.
<br> </br>
<table>
  <tr>
    <th>Company</th>
    <th>Contact</th>
    <th>Country</th>
  </tr>
  <tr>
    <td>Alfreds </td>
    <td>Maria </td>
    <td>Germany</td>
  </tr>
</table>
</body>

With the data create a html file. And then send that file in email as content.

use an expression to create your file data like this -

v_data= '  <tr>
    <td>'||company ||'</td>
    <td>'|| contact_person|| '</td>
    <td>'|| country ||'</td>
  </tr>'

Use an aggregator to concat all these data into one single row. group by none.

Then use another expression transformation.
create a ports like this -

v_head ='
<head></head>
<body>

<b>pls find below data.</b>
<table>
  <tr>
    <th>Company</th>
    <th>Contact</th>
    <th>Country</th>
  </tr>'

v_body = Aggregated_v_data

v_tail='</table></body>'

v_output = v_head||v_body ||v_tail

Then use this output and connect to a flat file target.

Then send this flat file sing mailx command/any mail client.

Output should look like this.
screenshot

html file should looks like this

<head></head>
<body>

pls find below data.
<br> </br>
<table>
  <tr>
    <th>Company</th>
    <th>Contact</th>
    <th>Country</th>
  </tr>
  <tr>
    <td>Alfreds </td>
    <td>Maria </td>
    <td>Germany</td>
  </tr>
</table>
</body>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文