Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Sending an Email in with Delayed Delivery.

kranthi_kiran5
Explorer
0 Kudos

Hi All,

I have a Requirement of Sending the Emails With Delayed Delivery, Just Like Outlook,

I Have Z-Program that sends a Remainder Emails, In which User Sets the date and time for Receiving Emails. Different Users sets a different time for getting the emails. We run the Program at 6 AM, and the User keeps time for around 10 AM.

Now My Program should generate Emails at 6 AM and reside in SOST Until the 10 AM and then sends to the Corresponding Receipent.

I am Using CL_BCS Class for Sending the Email.

Regards

Kranthi

1 ACCEPTED SOLUTION

mh97
Contributor

Please check this thread. I think it has your answer:

https://archive.sap.com/discussions/thread/752394

Below is copied from that link:

You can send the email in the future using the OO methods as well. Just not well documented but if you dig into the class itself, you'll find that CL_BCS has a public attribute called SEND_REQUEST which is of type CL_SEND_REQUEST_BCS. This class has a method to set the send time.

Example below, I'll set it 6 minutes from now.

data: lv_timestamp type timestamp. 
GET TIME STAMP FIELD lv_timestamp. 
lv_timestamp = CL_ABAP_TSTMP=>ADD( tstmp = lv_timestamp  secs = 360 ).
lr_cl_bcs->SEND_REQUEST->set_send_at( lv_timestamp ).
lr_cl_bcs->send( space ).

1 REPLY 1

mh97
Contributor

Please check this thread. I think it has your answer:

https://archive.sap.com/discussions/thread/752394

Below is copied from that link:

You can send the email in the future using the OO methods as well. Just not well documented but if you dig into the class itself, you'll find that CL_BCS has a public attribute called SEND_REQUEST which is of type CL_SEND_REQUEST_BCS. This class has a method to set the send time.

Example below, I'll set it 6 minutes from now.

data: lv_timestamp type timestamp. 
GET TIME STAMP FIELD lv_timestamp. 
lv_timestamp = CL_ABAP_TSTMP=>ADD( tstmp = lv_timestamp  secs = 360 ).
lr_cl_bcs->SEND_REQUEST->set_send_at( lv_timestamp ).
lr_cl_bcs->send( space ).