Sending e-mail to Internet e-mail addresses
In this recipe, we will see how we can modify the existing program so that, instead of the SAP user, we can send the same e-mail to an Internet address. We will make a copy of the same program and add additional code. The class that is to be used, in this case, is cl_bcs_cam_address
(instead of the cl_sapuser_bcs
class). The method create_internet_address
will be used for creating Internet user addresses.
How to do it...
We will now see the changes we need to make to the given program:
Instead of the
myrecipient
object reference being based upon the classcl_sapuser_bcs
, we will use the classcl_cam_address_bcs
.Next, we will call the method
create_internet_address
of thecl_cam_addess_bcs
class for creating an e-mail address.We may remove the
i_express
parameter assignment from theadd_recipient
method call of thecl_bcs
class (since the e-mail is going to an e-mail address outside the SAP system, pop-up express messages are irrelevant).Next we define...