Setting Up Communication with Simple Mail Transfer Protocol (SMTP)

Objectives

After completing this lesson, you will be able to:
  • Summarize the task of a Mail Transfer Agent
  • Perform the configuration of the AS ABAP for the use of SMTP

Introduction to Communication Using SMTP

Simple Mail Transfer Protocol (SMTP) is a standard for exchanging e-mails between servers in the network. Mail clients use SMTP to send e-mails to a server, but not to receive e-mails. It is supported directly by the ICM process. This means that it is possible to exchange e-mails between the SAP system and any SMTP-compatible mail server without using additional external components (such as connectors or gateways). You can use any product that meets the SMTP standard as a mail server.

The figure "Task of a Mail Transfer Agent (MTA)" shows a simplified e-mail system landscape for a company. If an e-mail is sent to the address info@sap.com, it first reaches a Mail Transfer Agent (MTA). This is a program (such as sendmail) that is responsible for forwarding and delivering e-mails. When a mail is received from a Mail User Agent (MUA) (the actual e-mail program) or a different MTA, the MTA analyzes the mail and either sends it to the local user (that is, their MUA) or forwards it to a different MTA (if alias rules have been defined, for example). In the example shown in the figure "Task of a Mail Transfer Agent (MTA)", the inbound e-mail is forwarded to the SAP ECC system with the local domain ecc.sap.com.

Note

SAPconnect is not an MTA and it cannot automatically forward inbound mails that are not intended for it to a different mail server.

Faxes and text messages (pager or SMS) can be exchanged using SMTP. Faxes and text messages are packed into e-mails for this purpose. For receipt, the fax or text message server or provider sends e-mails to addresses with the SAP system domain (such as to FAX=+1212541234@crm-prod.company.com).

Restrictions of the AS ABAP with Regard to Receiving SMTP Mails

As of AS ABAP 7.02, in the outbound direction, the SAP system can transfer mails created in one client to different mail servers. You can specify the host address and port number of the mail servers in the definition of the SAPconnect SMTP node. For details, see SAP Note 2348016Configure multiple SMTP NODEs in SAP System.

The AS ABAP can receive e-mails via SMTP and can redistribute these e-mails to Business Workplace users. In the inbound direction, the SAP system can receive mails from any number of mail servers. Each client can be reached by a separate virtual mail server (host name, port number) that is configured in transaction SICF. The best approach to address the SAP system and its clients is to use a separate subdomain for each client (such as d01.sap.com). The subdomains are assigned to host names and port numbers using routing rules on the mail servers. Note that SAPconnect cannot be an MTA itself, that is, it cannot forward the mails to other mail servers.

SMTP Configuration

To use the SMTP function, set the following profile parameters for the AS ABAP:

Note

The restriction is that the SAPconnect send job can only be scheduled for application servers on which SMTP is activated. You should therefore activate SMTP on all application servers of the SAP system.
  • rdisp/start_icman = true, this parameter starts the ICM process automatically during the system startup

    Hint

    In newer releases (as of SAP Kernel 7.72), this parameter does not exist any more: Here the instance always starts with an ICM process. For details, see SAP Note 2560792ABAP instances in S/4HANA always start with an icman process.

  • exe/icman = <path for the executable of the ICM>
  • icm/server_port_<xx> = PROT=SMTP,PORT=<port>, this parameter opens a TCP/IP port for receiving mails using the SMTP plug-in. <port> describes the port number. In case that no mails are to be received in this SAP system, set <port> to zero.

    Note

    The Internet Communication Manager process (ICM) also supports SMTP authentication and SMTP using TLS / SSL for inbound mails. For this, the profile parameter icm/server_port_<xx> offers the additional options TLS (configures SMTP using TLS / SSL), AUTHMECHANISMS (authenticates inbound mails) and AUTHUSERS (defines authorized AS ABAP users). For example, the setting icm/server_port_<xx> = PROT=SMTP,PORT=<port>,TLS=2 means that the client must encrypt with TLS; if not, the connection is cancelled. For more information, see the online documentation for SAP S/4HANA (Product Assistance), area SAP S/4HANAEnterprise TechnologyABAP PlatformApplication Server ABAP InfrastructureComponents of Application Server ABAPInternet Communication Manager (ICM)Administration of the ICMConfiguration of the ICM Server PortSMTP Authentication and SMTP Using TLS / SSL for Inbound Mails (System Type AS ABAP).

Hint

The parameter is/SMTP/virt_host_<xx> defines a virtual mail host for receiving mails. In case that all inbound mails (including status notifications) are to be received and processed in a single client of the SAP system, this parameter is not required and is/SMTP/virt_host_0 = *:*; is taken as the default. If multiple clients are intended as receivers, you must create a virtual host for each client.

To avoid performance bottlenecks due to high numbers of SMTP requests (or, optionally, HTTP/S requests), use parameters to restrict the context usage in the back-end SAP system for a protocol. Specify the percentage of all available contexts that can be used for the relevant protocol. In the SAP system, the maximum number of contexts in the system is limited by the profile parameter value of rdisp/tm_max_no (this parameter restricts the maximum number of logons for an instance). If the following quotas are exceeded, the requests will be rejected in the ICM:

  • icm/HTTP(S)/context_quota
  • icm/SMTP/context_quota

For example, with the setting icm/SMTP/context_quota = 20, you can specify that only 20 percent of the available contexts can be used for SMTP (mail functions). This means that you will have more capacity for HTTP(S) requests if there is a high workload.

Outgoing E-Mails in AS ABAP

E-mails are created either automatically using an application or manually in the SAP mail client (Business Workplace, transaction SBWP). They are sent to a mail server by SMTP. E-mails can also be displayed with a suitable mail client for this mail server, as shown in the figure "Outbound Mails: Process".

The abbreviations used in the figure are explained as follows:

POP
Post Office Protocol was defined in 1984 in connection with TCP/IP and allows the receipt of e-mails even on systems that cannot guarantee permanent connection to the mail server. POP3 is the standard protocol for most mail clients on the Internet (together with SMTP responsible for sending messages). The POP3 protocol can delete messages on the server or leave them there. It can also delete messages directly without first transferring them from the server. If more is required, such as hierarchical mailboxes, or filters, use the functions of the client; the protocol does not provide these; you may have to use IMAP.
IMAP

Internet Message Access Protocol is an e-mail protocol that allows the client to process mails on the server. You can also create folders on the mail server (remote mailboxes) to sort mails. IMAP was developed to transfer messages only when required. The users can choose (unlike with POP3) which data they want to transfer to their own computer.

SMTP

Simple Mail Transfer Protocol is the standard for exchanging e-mails between servers in the network. Mail clients use SMTP to send e-mails to a server, but not to receive e-mails.

MIME

Multipurpose Internet Mail Extensions consists of internet extensions (coding procedures) for including binary data in internet mails. In addition, MIME supports multipart mails to allow different data types in a mail or binary attachments, and mails in HTML format.

Configure Sending SMTP Mails

Steps

  1. Maintain the key profile parameters for SMTP.

  2. Maintain the user addresses (every user that wants to send e-mails requires an internet e-mail address). For security reasons, in case that users are maintaining their own data (transaction SU3), they cannot maintain the entries for the communication types E-mail (INT or SMTP) and Remote Mail (RML).

    1. Call transaction SU01 to enter the internet address under E-Mail Address on the Address tab page.

    Note

    You can use report RSADRCK7 to create e-mail addresses of type <User-ID>@<MailDomainName> automatically for all (SU01) users in your client. This report is described in more detail in the SAP note 104263Generating Internet addresses for users.
  3. Define the default domain of the current SAP system client:

    In transaction SCOT, choose Business Communication AdministrationSettingsSMTP ConnectionOutbound MessagesSettings, tab Outbound Settings, field Default Domain.

    Hint

    You need to do this for the following reasons:
    • The SMTP plug-in logs on to the mail server with the domain as an ID.
    • The message ID of the outbound e-mails is compiled using this domain.
    • If an SAP user sends an e-mail without an internet e-mail address, a sender address consisting of the SAP user name and this domain is generated.

    Note

    Make SAPconnect settings in transaction SCOT for every client from which you send messages.
  4. Configure an SMTP node to send an internet mail.

    1. Create an SMTP note in transaction SCOT (with or without wizard).

    2. In the Mail Host and Mail Port fields, specify the mail server to which the outbound mails are to be transferred.

      Note

      As of SAP Kernel 7.21, the SAPconnect SMTP interface supports both sending and receiving via a secure connection (TLS, Transport Layer Security) and a procedure for authenticating on the SMTP server (SMTP AUTH).You can make relevant settings for outgoing messages in transaction SCOT in the relevant SMTP node. For more information, see SAP Note 1724704SCOT: Settings for TLS and SMTP AUTH.

  5. Schedule a send job, because e-mails sent from an SAP application are initially placed in a wait queue. A background job that runs periodically, the SAPconnect send job, collects e-mails from the wait queue and sends them to the mail server.

    1. In transaction SCOT, use the menu to choose SettingsSend Jobs.

    2. Create a background job with a variant (for example, SAP CONNECT INT SEND).

    3. Schedule it periodically.

    Hint

    Schedule the job on an instance (application server) in which an ICM process is active.

Result

The figure "Configuring an SMTP Node" shows an example of configuring an SMTP node in transaction SCOT. It is possible to configure a node for sending faxes or for sending text messages in the same way.

Incoming E-Mails in an SAP System

When you send an e-mail from a mail client to a user in an SAP system, the e-mail is first forwarded to a mail server and then forwarded to the SAP system by the MTA. The e-mails are sent to the mail client in the SAP system (Business Workplace) on a client-dependent basis using SAPconnect. This is illustrated in the figure "Incoming Mails: Process".

The steps required to configure the mail connection in the SAP system are summarized in the figure "Configuring the Mail Connection".

Configure Receiving SMTP Mails

Steps

  1. Maintain the key profile parameters for SMTP.

  2. Enter transaction SU01 and create a system user with the authorization profile S_A.SCON (which is shipped by SAP).

  3. Maintain the internet mail address for every user that is to receive e-mails in an SAP system. For security reasons, users maintaining their own data (transaction SU3) cannot maintain the entries for the communication types E-mail (INT or SMTP) and Remote Mail (RML):

    Call transaction SU01 to enter the internet address under E-Mail on the Address tab page.

  4. Define the default domain of the current SAP system client:

    In transaction SCOT, choose Business Communication AdministrationSettingsSMTP ConnectionOutbound MessagesSettings. On the tab Outbound Settings, enter the data in the field Default Domain.

  5. For every client of an SAP system in which inbound mails (or status notifications for sent mails) are to be received and possibly processed, create an SMTP server node for which an assignment to a virtual mail host and logon data are stored.

    Note

    In transaction SICF, SAP already ships an SMTP server node for every SAP system. Use this for the first client that you want to be able to receive mails, and create a new SMTP server node for each additional client. If you are working with multiple clients, you need to create a virtual host for each client in which messages are received using the SMTP plug-in.

    Make sure that you do not delete the SMTP server node by accident, see SAP Note 2728590SAPCONNECT service has been deleted from SICF.

    1. Call transaction SICF and choose Execute. Under the list Virtual Hosts / Services, double-click SAPconnect.

    2. On the Host Data tab page, maintain the settings for parameter is/SMTP/virt_host_<*>= <host>:<port>,<port>,...;

      Note

      This parameter defines a virtual mail host for receiving mails. In case that all inbound mails (including status notifications) are to be received and processed by a single client in the SAP system, this parameter is not required. In this case, is/SMTP/virt_host_0= <*>:<*>; is used as the default. In case that multiple clients are intended as receivers, you need to create a virtual host for each client;<host> and <port> describe the name of the host and the port to which inbound mails are addressed.
    3. On the Logon Data tab page, enter the client to which the mails received by the virtual mail host are to be forwarded and maintain the logon data of the system user that has been created in this client for the inbound mails.

    4. On the Handler List tab page, add the handlerCL_SMTP_EXT_SAPCONNECT at position no. 1.

    Note

    Every SMTP server must be activated (in transaction SICF under Service/HostActivate from the menu or by clicking the right mouse button and using the context menu) after it has been created or changed.

Administration of SAPconnect

SAPconnect offers a uniform administration interface that can help to set up the external communication of an SAP system using SMTP and to monitor its running send operation. You can navigate from here to all settings relevant for SAPconnect. Additionally, the administration interface offers functions that help you to maintain and manage your SAPconnect environment.

Use transaction SCOT to configure SAPconnect for communication type Internet (e-mail via SMTP). You can use various views of the communication infrastructure in transaction SCOT. Start with the view Business Communication AdministrationAdministrationSystem State.

Schedule the send process periodically in transaction SCOT, by choosing Business Communication AdministrationSettingsSend Jobs.

Caution

Most settings of SAPconnect are client-dependent.

External communication systems log on to the SAP system as a system user. The authorizations for this user are contained in the profile S_A.SCON. The SAPconnect administrator requires the authorizations for the system user and the authorizations for table maintenance, which are checked using the authorization object S_TABU_DIS. These authorizations are contained in the roles SAP_BC_SRV_COM_ADMIN and SAP_BC_SRV_GBT_ADMIN.

Note

SAPconnect provides the option to send emails signed using S/MIME standards and/or encrypted or to receive and decrypt/verify e-mails that were encrypted and/or signed using S/MIME. The S/MIME standard has been integrated into SAPconnect. As an alternative to the option of creating secured messages using S/MIME using SAPconnect, you can also use the product of a third-party, such as a Secure Email Proxy. For this, choose Business Communication AdministrationSettingsOutbound MessagesSettings in transaction SCOT. Here on tab Signature & Encryption, you can select the required combination for the e-mail signature or encryption.

Send and Receive E-Mails Using SMTP with AS ABAP

Business Example

As a member of the system administration team, you want to implement the exchange of e-mails between an ABAP-based SAP system and an SMTP-compatible mail server without external components.

Task 1: Prepare Mail Client (Mozilla Thunderbird)

In this exercise, you will configure Mozilla Thunderbird as a mail client for the already prepared James mail server (both running on the WTS that represents your training environment).

Note

In this and in the following tasks of this exercise, ## represents the number that has been assigned to your group by the instructor.

Steps

  1. Configure Thunderbird on the WTS using the following connection data:

    FieldValue
    Your nameAny text, for example your name
    Email addresstrain-##@tm.sap.com
    Passwordmail##
    Remember passwordKeep selected
    Incoming Server | ProtocolPOP3
    Incoming Server | Hostnamewtshost.wdf.sap.corp
    Incoming Server | PortKeep empty
    Incoming Server | Connection securityAutodetect
    Incoming Server| Authentication methodAutodetect
    Incoming Server | Usernametrain-##
    Outgoing Server | Hostnamewtshost.wdf.sap.corp
    Outgoing Server | PortKeep empty
    Outgoing Server| Connection securityAutodetect
    Outgoing server | Authentication methodAutodetect
    Outgoing Server| Usernametrain-##
    1. In case you have not yet already done so, log on to the WTS of your training environment with the credentials provided by your instructor.

    2. Choose the Windows icon to launch the Windows start menu. Then choose Search.

    3. Type Thunderbird and select Thunderbird.

      Note

      At first startup, Thunderbird may launch the Welcome to Thunderbird screen. Ignore any error messages concerning the communication with the sign-up server (in case that they occur) and choose Skip this and use my existing email.
    4. In the Set Up Your Existing Email Address window, provide the following data and choose Configure manually.

      FieldValue
      Your nameAny text, for example your name
      Email addresstrain-##@tm.sap.com
      Passwordmail##
      Remember passwordKeep selected
    5. In the expanded Set Up Your Existing Email Address window, provide the following data and choose Re-test.

      FieldValue
      Incoming Server | ProtocolPOP3
      Incoming Server | Hostnamewtshost.wdf.sap.corp
      Incoming Server | PortKeep empty
      Incoming Server | Connection securityAutodetect
      Incoming Server| Authentication methodAutodetect
      Incoming Server | Usernametrain-## (make sure that any pre-filled ending such as @tm.sap.com is deleted)
      Outgoing Server | Hostnamewtshost.wdf.sap.corp
      Outgoing Server | PortKeep empty
      Outgoing Server| Connection securityAutodetect
      Outgoing server | Authentication methodAutodetect
      Outgoing Server| Usernametrain-## (make sure that any pre-filled ending such as @tm.sap.com is deleted)
    6. The probing will set the fields formerly left empty or set to Autodetect to concrete values. Choose Done.

    7. In the Security Warning window, select I understand the risks. and choose Confirm. You may need to confirm another popup with OK.

      Note

      In case that a popup on system integration appears, choose Skip Integration.

    8. If not already done, switch to tab Inbox.

    9. Right-click your mail account train-##@tm.sap.com and choose Get Messages. A Test message (in folder Inbox) should indicate that your inbox is OK. Keep this window open.

    Result

    You have configured Thunderbird to connect to the James mail server.

Task 2: Check the SMTP Configuration of Your SAP S/4HANA System

Steps

  1. For each instance of your SAP S/4HANA system, determine the port at which requests in the SMTP protocol are processed.

    1. Log on to the client 100 of your SAP S/4HANA system with the credentials of your course user (for example TRAIN-## where ## represents your group number). Your instructor will provide details.

    2. There are many ways to determine the port responsible for SMTP. The simplest method is to call transaction SMICM and choose Services.

      Hint

      The number that represents SMTP on the application server is listed in the first column (here and in the following represented by <xx>). The associated profile parameter is called icm/server_port_<xx - 1>.

      You can also find the value of the parameter in the following ways:

      • Call transaction SMICM and from the menu choose GotoParametersDisplay.

      • Call report or transaction RSPFPAR, restrict the search to icm/server_port* and choose Execute.

      • Call transaction RZ11 and check the profile parameters icm/server_port_<xx-1>.

      Note

      The port determined in this way applies only to the application server to which you are currently logged on.
    3. To analyze the other application server(s), call transaction SM51.

    4. Select the line of the application server in question and from the menu choose GotoMonitorsICM Monitor to start transaction SMICM on that application server.

  2. Only if your SAP S/4HANA system has not yet been configured for SMTP: enter transaction RZ10 to add the parameter icm/server_port_<next free number> to your default profile and assign the value PROT=SMTP,PORT=250$$ to this parameter. Save and activate the profile and then restart all the ICM processes of your system in transaction SMICM. Then repeat the first step of the task.

    1. If, during the previous step of this exercise in transaction SMICM, you discovered that SMTP is not configured, call transaction RZ10 and choose Extended maintenance for the latest version of the DEFAULTprofile in change mode.

      Hint

      If the profile is not available in the F4 help, use the menu to load the profiles by choosing UtilitiesImport profilesOf active servers.

    2. Choose (Create) Parameter.

    3. Enter icm/server_port_<next free number> as the Parameter Name, and PROT=SMTP,PORT=250$$ as the Parameter Value.

    4. Choose CopyBackSave to save your changes.

      Note

      If a dialog box appears, informing you about an incorrect parameter value, choose Yes and ensure that the new parameter icm/server_port_<next free number> is displayed correctly (ignore warnings concerning other parameters). If you are prompted to do so, activate the profile at operating system level.
    5. Choose Continue to confirm the following dialog boxes.

    6. Call transaction SMICM to restart the ICM processes. Here, use the menu to choose AdministrationICMExit SoftGlobal. Choose Yes to confirm the query. Then choose Services again and verify that the changes have been made.

      Note

      This is for the sake of simplicity only. For issues with the restart of the ICM process, see SAP Note 2367439Avoid manual restart of ICM process.

Task 3: Set Up the Sending of E-Mails in AS ABAP

After completing this task, you will be able to assign Internet/Mail addresses to user IDs, set the default domain as well as receipt confirmation, and configure the SMTP node.

Steps

  1. Assign the internet/mail address <UserID>@d##.sap.com, where ## is your (two-digit) group number to all users in the client 100 of your SAP S/4HANA system. Then, check the changes performed for your training user (for example, TRAIN-##).

    1. If you have not already done so, log on to your assigned SAP S/4HANA system with the credentials of your user ID TRAIN-##.

    2. Start the report RSADRCK7 (for example, by using transaction SA38 and choosing Execute).

    3. In the Domain field, enter d##.sap.com (where ## is your group number).

    4. Deselect the Keep existing addresses and Test mode checkboxes, and select the Use User IDs checkbox. Make sure that Create domain addresses is selected.

    5. Choose Execute and check the log that is displayed.

    6. Call transaction SU01 and display your user TRAIN-##.

      Result

      On the Address tab page, the E-Mail Address field should contain the value train-##@d##.sap.com (where ## is your group number).
  2. In client 100 of your SAP S/4HANA system, enter d##.sap.com as the default domain.

    1. Following the previous step. call transaction SCOT.

    2. In the menu structure on the left, choose Business Communication AdministrationSettingsSMTP ConnectionOutbound MessagesSettings and double-click on this entry.

    3. On the Outbound Settings tab, enter d##.sap.com (where ## is your group number) as Default Domain.

    4. Choose Save (in the Settings area).

  3. Configure SAPconnect so that no confirmation of receipt is expected for internet mails.

    Hint

    This setting means that sent messages of the internet mail type are immediately assigned the status Completed. Otherwise, they are in the In transit status until a confirmation of receipt is received.

    In the SAP system, the sending application determines if a confirmation of receipt is requested.

    1. Following the previous step, switch to the Status Requests tab.

    2. Select the Do not request read confirmat(io)ns generally checkbox.

    3. Choose Save (in the Settings area).

  4. Using the wizard, create a new SMTP node in your SAP system so that e-mails addressed to recipients in the mail domain tm.sap.com can be sent to the James mail server. Use the data from the following table:

    FieldValue
    NodeSMTP##
    DescriptionAny text, for example James Mail Server
    Mail Hostwtshost.wdf.sap.corp
    Mail Port25
    SecurityDo not use TLS
    Node (Type)(SMTP …) Internet
    Address area*@tm.sap.com
    Output formatsKeep default values

    Hint

    If the external mail server also operates as a Mail Transfer Agent (MTA) and you have specified only one SMTP node, you can enter * as an address area. However, in the training landscape, the mail server does not forward any e-mails, but processes only mails for the specified domain.

    1. If you have not already done, log on to your assigned SAP S/4HANA system with the credentials of your user ID TRAIN-##.

    2. Call transaction SCOT.

    3. In the menu structure on the left, double-click on Business Communication AdministrationSettingsSMTP ConnectionOutbound MessagesSMTP Nodes.

    4. In case that there is already an SMTP node, delete it by selecting the corresponding line, choosing Delete Node and confirming a popup with Yes (in this training, we want to start from a defined state).

    5. Choose the Create Node Using the Wizard button.

    6. For the following fields in the guided procedure, use the data from the table in the task statement and choose Continue to proceed to the next screen.

    7. When you are asked whether or not you want to set further address types, select N for No, and choose Continue.

    8. For Maximum waiting time for repeat send attempts, enter 30minutes. Ensure that Node is ready for use is checked. Choose Continue.

Result

Your SMTP node SMTP## is now ready to use and is responsible for all e-mails sent to the specified address range. It can connect to an SMTP-compatible mail server.

Task 4: Send an E-Mail from AS ABAP

Steps

  1. In your SAP S/4HANA system, enter SAP Business Workplace and create an e-mail to the (external) recipient train-##@tm.sap.com.

    1. If you have not already done, log on to your assigned SAP S/4HANA system with the credentials of your user ID TRAIN-##.

    2. Call transaction SBWP.

    3. Choose New message.

    4. In the new window, create a message (using any title and document contents).

    5. For Recipient, enter train-##@tm.sap.com.

      Note

      When you press Enter to transfer the address, the SAP system identifies from the structure of the address that it is an Internet address. Messages can be sent to different types of addresses (see the F4 help for the Type field).

    6. Choose Send....

  2. In the system status of SAPconnect, check if there is (at least) one waiting message of the Internet type. Then, after checking the trace options, start the SAPconnect send process manually.

    1. Following the previous step, call transaction SCOT.

    2. In the menu area on the left, double-click on Business Communication AdministrationAdministrationSystem State. For the Internet address type, you should see at least one message in the status Waiting.

    3. From the menu, choose UtilitiesTrace Settings.

    4. Set all three settings to Errors Only and confirm your settings with Copy.

    5. Now double-click on Business Communication AdministrationAdministrationOutbound Send Requests in the menu structure. The waiting message appears.

      Hint

      Note the selected options on tab Period and on tab Send Status.
    6. On tab Send Status, choose Refresh and select the message(s) in status Waiting.

    7. Choose Start Send Process for Selection (the Execute icon).

    8. Confirm the popup Start Send Process for Selection with Yes.

    9. On tab Send Status, make sure that all checkboxes are selected and choose Refresh again.

    10. View the status of the message(s) once the send process is completed.

      Note

      In case of a message is in status error, select the line with the message in question and do one of the following:

      • Choose the link in the Msg column to view details of the error message.
      • Choose the Trace button to view the workflow trace.
  3. Within Thunderbird, check whether your mail has arrived.

    1. Switch to your open Thunderbird window from a previous task.

    2. If the new mail does not show up in your Inbox folder, right-click your mail account train-##@tm.sap.com and choose Get Messages.

    3. Switch to the Inbox folder and check your new message.

  4. Schedule the send process for internet mails periodically (every five minutes).

    1. If you have not already done, log on to your assigned SAP S/4HANA system with the credentials of your user ID TRAIN-##.

    2. In transaction SCOT, in the menu structure on the left, double-click on Business Communication AdministrationSettingsSend Jobs.

    3. Choose Schedule Job for INT (this is one option of the Schedule Job (Create) button).

    4. On the resulting screen to select the send variant, change the Period to 5 minutes, keep the other settings unchanged and choose Continue.

    5. On the Define Job screen, choose Save.

    Result

    You have scheduled a send job which you can – for example – check or delete in transaction SCOT.
  5. Optional: Send a list output (such as the report SHOWCOLO) to recipient train-##@tm.sap.com and observe how the output is sent during the next send process.

    1. Following the previous step, call transaction SA38 and execute the programSHOWCOLO.

    2. On the resulting list. from the menu, choose ListSave/SendOffice.

    3. Enter train-##@tm.sap.com as the Recipient. Press Enter.

      Result

      The system adds the report title as the default title of the message.
    4. If you find it useful, enter some text as the Document contents.

    5. Choose Send... to transfer your message to SAPconnect.

      Note

      The message is processed by the send process within the next five minutes. Keep this window open.

    6. Check your Thunderbird inbox for a new mail in the same way as you did in a previous step and note its attachment. Keep this window open.

Task 5: Receive E-Mails in AS ABAP

The figure Training Landscape for Inbound Mail shows the training infrastructure of incoming mail.

Steps

  1. In your SAP S/4HANA system, create the technical user MAILDISP## to distribute e-mails in the current client. This user should be of type System. The user should have an initial password chosen by you and it should be assigned to the authorization profile S_A.SCON provided by SAP.

    1. If you have not yet already done, log on to the client 100 of your SAP S/4HANA system with the credentials of your training user (for example, TRAIN-##).

    2. Start transaction SU01.

    3. In the User field, enter MAILDISP## and choose (Create) Technical User.

    4. On the Logon Data tab, select the user typeSystem.

    5. Enter a new password (that fulfills the password requirements) of your choice twice.

      Hint

      Users of type System are intended for dialog-free communication between different systems and are excluded from the checks for expired passwords. For more information, see SAP note 622464Change: Password change requirement for user type "SYSTEM".

    6. On the Profiles tab, enter the authorization profileS_A.SCON.

    7. Choose Save.

  2. Enter the user ID that you have just created in the virtual host for SAPconnect (transaction SICF). Remember to activate the virtual host after changing it.

    1. Following the previous step, in your SAP S/4HANA system, call transaction SICF.

    2. On the initial screen of transaction SICF, select the hierarchy type SERVICE and choose Execute.

    3. Double-click the SAPconnect entry under Virtual Hosts/Services.

    4. On the Logon Data tab, switch to change mode.

    5. Enter the data for user MAILDISP## (client, user and password). Leave all other fields unchanged and store (save) your changes. Then choose Back to switch back to the Define Services screen.

      Hint

      If you receive an error message while selecting the language for the user, stating that a code page is not supported, activate your language by calling report RSCPINST. Here, add your language on the initial screen of this report and choose Activate.

    6. In the Define Services screen of transaction SICF, click the SAPconnect entry with the secondary mouse button, and choose Activate SMTP Host. On the following popup, choose Yes to confirm the subsequent dialog box.

      Hint

      An SMTP server is required for each client of an SAP system in which e-mails can be received. You have now created the connection to a virtual mail host. In case that e-mails were also to be delivered to other clients in your SAP system, you would have to create additional virtual mail hosts for these clients in transaction SICF.
  3. In Thunderbird, change the settings of your account train-##@tm.sap.com to send outgoing mails via SMTP to the PAS instance of your SAP S/4HANA system.

    1. Switch to your open Thunderbird window (from the previous task).

    2. Right-click your mail account train-##@tm.sap.com and choose Settings.

    3. In the left pane, select Outgoing Server (SMTP).

    4. In the right pane, choose Edit....

    5. Provide the following data and choose OK:

      FieldValue
      DescriptionAny text, for example AS ABAP
      Server Names4Xhost.wdf.sap.corp replace X accordingly to q|p
      PortThe ICM SMTP port of your PAS instance 25021|25031
      Connection securityNone
      Authentication methodNo authentication
      User Name<keep unchanged>
  4. In Thunderbird, send a mail (suggestion: as a reply to a mail from the sender train-##@d##.sap.com).

    1. Switch to or open Thunderbird window, Inbox tab.

    2. Navigate to the inbox folder of your mail account train-##@tm.sap.com.

    3. Double-click one of the mails from the sender train-##@d##.sap.com.

    4. Choose Reply.

    5. Enter some text and choose Send.

  5. Check the inbound send requests of SAPconnect.

    1. If you have not yet already done, log on to the client 100 of your SAP S/4HANA system with the credentials of your training user (for example TRAIN-##).

    2. Call transaction SCOT.

    3. In the menu structure on the left of the screen, double-click on Business Communication AdministrationAdministrationInbound Send Requests. Your inbound send request should appear (on tab Received At). By using the buttons offered, you have the option to display the details, the document, or the trace.

  6. Check your inbox in the SAP system.

    1. Following the previous step, start transaction SBWP in your SAP S/4HANA system to enter the SAP Business Workplace. Your e-mail should show up in folder InboxDocuments.

Related Information: Setting Up Communication with SMTP

For more information on setting up communication with SAPconnect, see the online documentation for SAP S/4HANA 2020 (Product Assistance) following the path SAP S/4HANAEnterprise TechnologyABAP PlatformApplication Server ABAP InfrastructureOther ServicesServices for Business UsersSAPconnect (BC-SRV-COM)

In addition, the following SAP notes might be helpful:

  • SAP Note 455140Configuration of e-mail, fax, paging or SMS using SMTP
  • SAP Note 455127E-mail (SMTP) in different SAP releases
  • SAP Note 312690SAPconnect: Collective note
  • SAP Note 149926Secure e-mail: Encryption, digital signature
  • SAP Note 104263Generating Internet addresses for users
  • SAP Note 690020SAPconnect send process hangs with large mails
  • SAP Note 3085702Dump STRING_SIZE_TOO_LARGE occurred for email sending background job
  • SAP Note 607108Problem analysis when you send or receive e-mails
  • SAP Notes 633265, 664833, 694151 and 883840SMTP PlugIn: Multi-codepage ability
  • SAP Note 1724704SCOT: Settings for TLS and SMTP AUTH
  • SAP Note 1702785Error diagnosis for SMTP using TLS and SMTP authentication
  • SAP Note 2148070Configuration of e-mail using SMTP (outbound) [Video] with a link to a troubleshooting guide
  • SAP Note 2348016Configure multiple SMTP NODEs in SAP System
  • SAP Note 2337000Can SAP system pull emails from the Exchange server?
  • SAP Note 2979460AS ABAP: Default value of profile parameter SAPLOCALHOSTFULL changed with ABAP Platform 2020
  • SAP Note 3064215Error message XS816 'SMTP communication error' for SMTP messages in SOST
  • SAP Note 3141466DNS Server Network Error (dns_unresolved_hostname) when using HTTP enabled applications
  • SAP Note 2417443Inbound error "554 Transaction failed"
  • SAP Note 2728590 - SAPCONNECT service has been deleted from SICF

Log in to track your progress & complete quizzes