cancel
Showing results for 
Search instead for 
Did you mean: 

API SMTP send Mail SPS09 - new question

Former Member
0 Kudos

We have sent with this API an automatic generated e-mail from a non existing sender address no_reply.....@sap.com to an existing external e-mail address. The response is "sent with o.k." although no e-mail is sent. (I assume no e-mail is sent because the recipient receives no e-mail). At the moment this e-mail vanish. 

The question:

is a API documentation available regarding the response handling of this API? In which case I get back which response? Or is this a question of the mailserver customizing? Or is the usage of this API restricted - some preconditions existing? 

Any help is appreciated.

Our further investigations:

This combination is working:

valid .....@sap.com sender address to valid ...@sap.com recipient address

valid .....@sap.com sender address to valid ...@external recipient address

non existing ..no_reply@sap.com sender address to valid ...@sap.com recipient address

In all of these cases the response of the API is "sent with o.k."

This combination is not working:

valid .....@sap.com sender address to invalid ...@sap.com recipient address

In this case is the response: "Exception: Error: error couldn't send RCPT header Stack Trace....."


Accepted Solutions (0)

Answers (1)

Answers (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

API documentation is here:

http://help.sap.com/hana/SAP_HANA_XS_JavaScript_API_Reference_en/$.net.Mail.html

Returns:

The object contains two properties: 'messageId' and 'finalReply'. The property 'messageId' contains the generated messageId and the property 'finalReply' contains the last reply from the mail server.

You might be encountering mail routing rules in the STMP relay which it isn't returning to the HANA server.

Former Member
0 Kudos

Hi Thomas,

a big "thank you" for pointing us to the up-to-date JSDoc explaining the return value of the send() function, which was not part of the "preliminary" version of the API doc, which I used.

We've now two additional questions to use this API in a HANA XS application:

1) What can we do with the value of 'messageId'? In particular we wonder whether this might be useful if the mail was sent, but a mailer demon replies (after some time) with an "undeliverable" error.

2) Our application runs on several systems in different landscapes (dev, cons, cloud, hcp, ...). How can we find out, which (and where) the SMTP relay instance is, and which routing rules are configured there?

Any hint is appreciated 🙂

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>What can we do with the value of 'messageId'? In particular we wonder whether this might be useful if the mail was sent, but a mailer demon replies (after some time) with an "undeliverable" error.

This is the unique id returned by the mail server.  I suppose this would primarily be used to troubleshooting/tracking scenarios. This isn't automatically persisted or anything on the HANA side. It would be up to your application to use/store it as you see fit.

>Our application runs on several systems in different landscapes (dev, cons, cloud, hcp, ...). How can we find out, which (and where) the SMTP relay instance is, and which routing rules are configured there?

I'm not sure I understand this question.  You have to configure your SMTP server/relay address in the XSAdmin tool.  This should tell you where the SMTP server/relay is. That's all we really have from the HANA side - just an address and authentication information.  Everything else would be handled from the SMTP server/relay side.

Former Member
0 Kudos

The API is working correctly - the problem was the correct set up of an email account in our cloud application and other questions. Therefore the question regarding the API is solved.