cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Send mails using On-premise mail server SAP CLOUD SDK JAVA

alex_aguilera
Explorer
0 Likes
6,416

Hello,

I'm trying to use a on-premise mail server using SAP CLOUD SDK JAVA. I didn't find any example of how to do it. I know that in case of javascript there's "email-client" (https://sap.github.io/cloud-sdk/docs/js/features/mail-client#on-premise-destination), but for java?

I found this guide: https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/using-tcp-protocol-for-cloud-applicat...

But it's not a full example, and it's not very clear. Right now, I have a working code that uses Java Mail to send mails using a mail destination (getting destination properties and creating the mail session), but i don't have very clear how to do it with an on-premise destination and use the configured cloud connector.

Could someone share some code example?

Thanks.

Accepted Solutions (0)

Answers (2)

Answers (2)

ManolV
Product and Topic Expert
Product and Topic Expert
alex_aguilera
Explorer
0 Likes

The second link is using the javascript mail client.

The first one...i will give it a try, but there's no code available in github.

Thanks for your time.

Ulrich_Schmidt1
Product and Topic Expert
Product and Topic Expert
0 Likes

alex_aguilera You could perhaps use the standard Java Mail Client javax.mail?

ksivakumar
Associate
Associate
0 Likes

Unfortunately, SAP Cloud SDK for Java does not currently support a Mail client.
You could write to our PO dsfas for adding this as a feature request, citing your requirements, but as we are currently working on a new major version of the SDK, I am not really sure if this would be taken up soon.

alex_aguilera
Explorer
0 Likes

Ok, I will do it.

As a workaround, do you have some complete example of how to do the same without the mail client? In github for example, i didn't find anything in https://github.com/SAP-samples/cloud-cap-samples-java for example.

Has someone done this first?

Thanks.

Junjie
Product and Topic Expert
Product and Topic Expert
0 Likes

We discussed in the team. Unfortunately, the mail client is not planned for the Java SDK at least in 2024. Please check the BTP documentation: https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/using-tcp-protocol-for-cloud-applicat... which was used as the guide for building the JS SDK implementation.