cancel
Showing results for 
Search instead for 
Did you mean: 

LF to CRLF conversion issue in mail attachment generated using MAIL Package

Former Member
0 Kudos

Hello All,

We have implemented a file to mail adapter scenario (PI 7.31) , wherein we have used MAIL Package to generate dynamic file name to the mail attachment and a
UDF to populate the file content.

We are facing an issue here. The issue is, the mail attachment is getting only “LF” but our requirement is to send “CRLF” at the end of each line in the output file.

We tried below solutions:

  1. Module in the receiver mail adapter

        Module Name: SAP XI Sample/ConvertCRLFfromToLF

        Parameter Name: mode

         Parameter Value: LFtoCRLF

    2. In the UDF we tried adding ‘\r\n’ in both hexa decimal and ascii format. Here only ‘\n’ is getting populated in the file and ‘\r’ is ignored.

    3. We also tried using all content encoding options available in the receiver mail adapter.

None of the above solutions worked for us. Kindly let us know your thoughts on this and appreciate if you could give us some inputs to resolve the issue.

Thanks in advance.

Kavita

Accepted Solutions (0)

Answers (2)

Answers (2)

stefan_grube
Active Contributor
0 Kudos

I had a similar issue with mail adapter. After some tests with different mail receivers, I noticed that the mail server is responsible for this behaviour and there is no way to influence it. I found the same information with google search as well.

I recommend to check, if there is a problem with LF at receiver side. When you use for example Microsoft Excel to read the attachment, it works with LF or CRLF identically.

Former Member
0 Kudos


Hi Stefen,

Thanks for the response, We had  added CRLF in the module and it worked fine when we opened in notepad also.
But now we are not able to replicate the same via the ESR code , Mail Package.
Please let us know if there is any other Alternative using the ESR code
Regards
Kavita
stefan_grube
Active Contributor
0 Kudos

Hi Kavita,

As I wrote before, there is no way to influence LF/CRLF with mail package. Whatever you put as line end character, the mail server will use the standard line end character instead (which is LF in your case)

On the other side: besides Microsoft notepad, must program do not make a difference, whether you have LF or CLRF, so check first, of the receiver of the message has an issue at all.

Regards

Stefan

naveen_chichili
Active Contributor
0 Kudos

Hi Kavita,

You can simply use Transfer mode as Text instead of binary and File Type as Text with File Unicode as UTF-8 in receiver channel which will convert LF to CRLF without any module.


Thanks,

Naveen

Former Member
0 Kudos

Hello Naveen,

Thanks for the response. But we do not have these parameters in reciever mail channel.

Regards,

Kavita