Skip to Content
0
Former Member
Apr 27, 2010 at 05:38 PM

Class CL_BCS sending email

52 Views

Hello,

I am using the below code for sending a email with PDF attachment using CL_BCS, once i get the email i am also getting 2 other emails saying your email delivered and your email read, is there a way for not getting those delivered and read emails,

TRY.

SEND_REQUEST = CL_BCS=>CREATE_PERSISTENT( ).

LP_PDF_SIZE = XSTRLEN( STRING ).

PDF_CONTENT = CL_DOCUMENT_BCS=>XSTRING_TO_SOLIX(

IP_XSTRING = STRING ).

CATCH CX_BCS INTO BCS_EXCEPTION.

RETURN-TYPE = 'E'.

RETURN-MESSAGE = BCS_EXCEPTION->ERROR_TYPE.

APPEND RETURN.

EXIT.

ENDTRY.

*

DOCUMENT = CL_DOCUMENT_BCS=>CREATE_DOCUMENT(

I_TYPE = 'RAW'

I_TEXT = L_BODY

  • i_hex = pdf_content

  • i_length = lp_pdf_size

I_SUBJECT = 'test' ).

*

CALL METHOD DOCUMENT->ADD_ATTACHMENT

EXPORTING

I_ATTACHMENT_TYPE = L_EXTENSION

I_ATTACHMENT_SUBJECT = 'test''

I_ATTACHMENT_SIZE = LP_PDF_SIZE

I_ATT_CONTENT_HEX = PDF_CONTENT.

SEND_REQUEST->SET_DOCUMENT( DOCUMENT ).

RECIPIENT = CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS(

I_ADDRESS_STRING = 'emailid'' ).

SEND_REQUEST->ADD_RECIPIENT( I_RECIPIENT = RECIPIENT

I_EXPRESS = ' '

I_COPY = ' '

I_BLIND_COPY = ' '

I_NO_FORWARD = ' ' ).

SENT_TO_ALL = SEND_REQUEST->SEND(

I_WITH_ERROR_SCREEN = 'X' ).

COMMIT WORK AND WAIT.