Hello everyone,
I',ve been searching SCN to similar cases and can see some but can not find a solution for my problem, my scenario is:
SOAP -> SAP PI 7.4 AEX java only -> Mail
I'm trying to send an email with attachment following the blog:
XI Mail Adapter : Dynamically building attachment and message body content using a simple UDF
Comm channel is Message Protocl as "XIPAYLOAD" with mail package checked, content encode as None and Keep attachments unchecked.
Mail package field "content type" with value multipart/mixed; boundary="--AaZz" , also triedmultipart/mixed; boundary=--AaZz
Created a UDF to fill up "Content" field of mail package with the following code:
String CRLF = "\r\n";
String output = new String("");
output = boundary + CRLF + "Content-Type: text/plain; charset=UTF-8" + CRLF + "Content-Disposition: inline" + CRLF + CRLF + body + CRLF + boundary + CRLF + "Content-Type: application/xml; name=" + filename + CRLF + "Content-Disposition: attachment; filename=" + filename + CRLF + CRLF + attachment + CRLF;
return output;
as you can see is really simple. The email is actually sent but without attachment and in body is the whole content string as follows:
--AaZz
Content-Type: text/plain; charset=UTF-8
Content-Disposition: inline
Mail Body
--AaZz
Content-Type: application/xml; name=Test.txt
Content-Disposition: attachment; filename=Test.txt
Mail Body
Any ideas of what I'm doing wrong?, any comments are really appreciated.
Thanks in advance.
Regards,
Julio Cesar