我有发送电子邮件的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;