I have a base64Binary encoded file(eg:pdf,img,doc). In Mule I'm setting this encoded data as an outBoundAttachment to eventually send it as attachments using SMTP. How to decode or apply decoding transformer only to the outbound attachment and send it in smtp.
<set-attachment attachmentName="xml.pdf" value="#[flowVars['pdf']]" contentType="application/pdf" doc:name="Attachment"/>
<base64-decoder-transformer />
<string-to-byte-array-transformer />
<smtp:outbound-endpoint host="smtp.gmail.com" user="${username}" password="${pwd}" connector-ref="smtpConnector" to="${toAddress}" from="${fromAddress}" mimeType="text/html" subject="This is sample from mule" responseTimeout="10000" doc:name="SMTP">
<email:object-to-mime-transformer useOutboundAttachments="true"/>
</smtp:outbound-endpoint>
Currently I'm getting:
'Failed to transform from "base64" to "org.mule.transformer.types.SimpleDataType"'
'Bad Base64 Input character at 0:60(decimal)'