How to Configure SMTP for an SAP HANA XS System in the SAP Cloud Platform Neo Environment
Do you want to send e-mails from an SAP HANA extended application services, classic model application (XS) on SAP Cloud Platform through the server of an e-mail provider, but you’re struggling to configure SMTP?
In this blog post, we explain how to set up a connection between your e-mail provider and your SAP HANA XS database system. Once you’ve downloaded and installed the SSL certificate, we’ll guide you through the trust store and SMTP configuration in the SAP HANA XS Administration tool.
In this example, we’ll show you how to use Microsoft Office 365, but you can use any other e-mail provider.
Let’s get started!
- An SAP HANA XS database system, which belongs to an enterprise account, is available in your subaccount in the Neo environment.
- You have information about the SMTP settings of the e-mail provider you want to connect your SAP HANA system to. For Office 365, we’ll use the following settings:
- The SMTP server, for example, office365.com
- The SMTP port, 587
- The authentication type, STARTTLS
- An app password for Office 365. You can find more information about this here.
- Credentials for the MTA Account
- You have a database user with the following SAP HANA roles:
To learn how to create a database user and how to assign roles to the user, see Create a Database Administration User for SAP HANA XS Databases. For information about roles, see SAP HANA XS Administration Roles.
Download and install the SSL certificate
We’ll start by downloading and installing the SSL certificate:
- Download the SSL certificate from the website of your SMTP provider.
If you can’t find it on their website, you can download it via openssl.
- To use STARTTLS, run the following commands:
Windows: openssl.exe s_client -connect smtp.office365.com:587 -starttls smtp
Linux: openssl s_client -connect smtp.office365.com:587 -starttls smtp
Configure the Trust Manager
Now log into the Trust Manager in the SAP HANA XS Administration Tool and set up the Trust Store for your e-mail provider:
- Start the SAP HANA XS Administration Tool. You can access the tool using the following URL: https://<subaccountid+appid>.hana.ondemand.com/sap/hana/xs/admin/#/trustManager
Provide your subaccount and app ID.
- Start the Trust Manager and create a new trust store. Follow the steps described in Add/Edit a Trust Store. You can assign any name you like. In this example, we’ll use “SMTP”.
- In the Certificate List panel, choose Import Certificate > Browse to upload and import the certificate of your e-mail provider.
You can configure SMTP in a number of ways. The configuration settings depend on your e-mail provider. For example, the Authentication and Transport Security settings usually differ between providers.
- In the SAP HANA XS Administration Tool, start the SMTP Configurations
- Enter the following settings:
|Settings||What You Need to Enter||Example|
|General SMTP Settings||Mail Server Host||Enter the SMTP Server of your e-mail provider.||smtp.office365.com|
|Mail Server Port||Enter the port of the SMTP server.||587|
|Authentication||Authentication Type||The authentication type you use depends on your provider and your security requirements. Possible options include CRAM-MD5, Digest-MD5, as well as Plain or Auto authentication.||
|Username/Password||Enter the credentials that your provider gave you to authenticate yourself to their services. In most cases, this will be a technical user.||
Password: <previously created app-password>
|Transport Security Settings||Transport Security||
Decide which type of encryption you want to set:
– STARTTLS starts with an unencrypted session and then adds TLS after the initial connection.
– SSL/TLS has a more traditional SSL implementation, but supports the same level of encryption.
|Trust Store||Select the Trust Store that you created, so that the SAP HANA system trusts the e-mail provider you’re connecting to.||SMTP|
|Other Settings||Timeout (in Milliseconds)||The timeout to the e-mail provider. You can usually provide the default value.||60000|
|Socket Proxy Settings||SOCKS Proxy||
SOCKS proxy is sometimes used for e-mail delivery. This communication type is not often used, as it includes an additional abstraction layer.
If your e-mail provider doesn’t require this setting, we recommend keeping it disabled.
For more information about settings, see SMTP Configuration Details.
- Save your changes.
Test your settings
To verify your settings, you can use the notification feature of the DP Task Monitor.
You can only use the DP Task Monitor to test your settings if you can send e-mails from different e-mail addresses, which depends on the offering of your e-mail provider. A standard Office 365 account, as we use it in this example, is not able to send emails from different addresses.
- Set a sender address under DP Task Monitor > Settings.
- Select a job and choose Notifications.
- Choose Add and configure the target address:
And you’re done!
Tip: If you encounter issues with your SMTP settings, check if your installed database revision is affected by the behavior described in SAP Note 2481536.
(This post has been drafted with support by Markus Stegmueller)
We hope this information helped you to configure SMTP for your SAP HANA XS database systems. For more information about using the SAP HANA service in the Neo environment, see SAP Cloud Platform, SAP HANA Service in SAP and Microsoft Azure Regions.
Great blog. We already have an existing SMTP configuration in place and want to setup another SMTP server/port for HANA DB on SCP Neo. We don't see the option to do so. Do you know if this is possible or not
Thanks for your comment! It is only possible to configure one SMTP server per HANA XS server (see the chapter Maintaining SMTP Server Configurations in the SAP HANA Administration Guide.)
Excellent blog! We were able to put it to use today successfully.
I'm happy to hear that 🙂 Thanks for the feedback.