smtp - 我有发送电子邮件的 e-sql 代码。它工作正常,但 Base64 编码文件不会添加到电子邮件附件中,因此电子邮件没有它
问题描述
我有发送电子邮件的 e-sql 代码。它工作正常,但不幸的是 Base64 编码文件不加到电子邮件附件中,因此电子邮件没有它
CREATE COMPUTE MODULE Marketing_Mail_Distribution_Flow_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
-- SET OutputRoot.Properties = InputProperties;
SET OutputRoot.Properties.CodedCharSetId = '1208';
SET OutputRoot.Properties.Encoding = '546';
SET OutputRoot.EmailOutputHeader.From =InputRoot.XMLNSC.Email.From;
SET OutputRoot.EmailOutputHeader.To = InputRoot.XMLNSC.Email.To;
SET OutputRoot.EmailOutputHeader.Subject = InputRoot.XMLNSC.Email.Subject;
SET OutputRoot.BLOB.BLOB = CAST(InputRoot.XMLNSC.Email.Text AS BLOB CCSID 1208 );
SET OutputLocalEnvironment.Destination.Email.BodyContentType = 'text/html; charset=utf-8';
--Tried both of these pieces of code to set Attachment to base64 attachment which is sent via SOAP
--SET OutputLocalEnvironment.Destination.Email.Attachment.Content = InputRoot.XMLNSC.Email.Attachment;
SET OutputLocalEnvironment.Destination.Email.Attachment.Content = CAST(BASE64DECODE(InputRoot.XMLNSC.Email.Attachment) AS BLOB CCSID 1208);
SET OutputLocalEnvironment.Destination.Email.Attachment.ContentType = 'multipart/related;boundary=myBoundary';
SET OutputLocalEnvironment.Destination.Email.Attachment.ContentName = InputRoot.XMLNSC.Email.AttachmentName;
SET OutputLocalEnvironment.Destination.Email.Attachment.ContentEncoding = 'base64';
END;
END MODULE;
解决方案
推荐阅读
- reactjs - Bugsnag ErrorBoundary 显示自定义错误,然后默认浏览器覆盖
- javascript - 为什么这个 Node 应用程序在保存到 MongoDB 时会挂起?
- android - AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM 不工作
- python - Django 3:过滤字母或非字母的查询集
- reactjs - 从刀片到反应组件的复杂数据未显示
- node.js - 在嵌入中提及用户
- html - 如何固定下拉菜单的块大小
- linux - vscode,如何启动和调试从管道读取的程序?
- node.js - 如何实现 Stripe 的 per-request 认证?
- javascript - 多重选择 - 使用数据库中的值填充