cancel
Showing results for 
Search instead for 
Did you mean: 

How to send pdf as mail attachment From CPI

Mohsinkhan
Explorer
0 Kudos

Hi Guys,

We have a requirement to fetch payslip from SFTP which is in PDF format and send it as a mail attachment to that particular employee.

We are basically fetching file and then encoding it with Base 64 encoder. Then storing that value in a header and sending that header as attachment. Mail received is not getting opened in any pdf reader.

Can you help me understand what needs to be done.

sriprasadshivaramabhat sriprasad.shivarambhat can you help

Regards,

Ankit

Accepted Solutions (0)

Answers (2)

Answers (2)

VijayKonam
Active Contributor
0 Kudos

Use message.addAttachment method to add the pdf file as an attachment to the exchange message. It should follow through in the email as well. However, I did not try this.

refer - https://help.sap.com/doc/a56f52e1a58e4e2bac7f7adbf45b2e26/Cloud/en-US/com/sap/gateway/ip/core/custom...

Neeraj_Jain
Active Contributor
0 Kudos

Hello Ankit Pallav

Please refer below SAP Blog. Might be it's helpful to you.

https://blogs.sap.com/2019/11/04/send-pdf-and-csv-file-as-zipped-content-in-mail-in-sap-cpi/

If satisfied please accept the answer.

Regards,

Neeraj Jain