
In this tutorial you will learn how to send e-mails from your BSP application.
This is an example. For more information about sending mails see the documentation Business Communication Services. The server configuration for the SMTP protocol is described in section Settings for Sending With the SMTP Plug-In.
For more information, see:
To complete this tutorial you should already have the following skills:
Basic knowledge of creating BSP applications
Know how to handle incorrect entries (see also Handling Incorrect Entries)
Basic knowledge of using application classes
To send an e-mail, your SAP Web Application Server must be configured as an SMTP server. This contains the following:
The SMTP plug-in must be available and configured in the profile
In transaction SCOT mailing (SMTP) must be activated and configured
A mail domain must be assigned to your system
Ask your system administrator to do this.
For more information about the configuration for e-mail, fax, paging/SMS using SMTP, see SAP Note 455140
.
A mail request consists of the following objects:
Document (type CL_DOCUMENT_BCS)
Sender (type CL_SAPUSER_BCS)
Receiver (type IF_RECIPIENT_BCS)
Possible attachments
Mail request (type Typ CL_BCS)
The objects are created, filled and linked to the mail request. Then give the mail request the command to dispatch itself. After some time (depending on the configuration) the mail request is executed.
This tutorial follows on from the tutorial on error handling (see also Handling Incorrect Entries). The application created there is enhanced to incorporate sending confirmation mails.
You can find the example BSP application, BSPTUTORIALMAIL and the application class, CL_BSP_TUT_MAIL, which the tutorial is based on, in the SAP System in package SBSP_DOCU.
First, create the Order Page.
Then create the Application Class with the associated attributes and methods.
Then code the Mail Class Call.