11-30-2007 9:16 AM
Hi ,
To send external mails from r/3 we have the std FM SO_NEW_DOCUMENT_SEND_API1. We are presently using this FM to send external mails ,The only issue being that sent mails can me read from tcode SOST if the user has the required authorization.
Is there any way to send external mails from r/3 directly which cannot be read in r/3 or encrypted when seen from r/3?
Thanks
11-30-2007 9:23 AM
11-30-2007 9:50 AM
thanks for replying .. we have a job in place which picks up mails from sost and sends it .. we want to avoid anyone readingthe mail ... in the time duration before the scheduled job kicks off.#
i.e from the time the mail sits in sost to the time the job picks it up.
11-30-2007 9:55 AM
Try this program..
Change the mail id in it..
REWARD IF USEFUL
REPORT ZMAIL .
data reciever type table of ADR6-SMTP_ADDR.
data subject type SO_OBJ_DES.
data text type bcsy_text.
data line type soli-line.
data send_request type ref to cl_bcs.
data document type ref to cl_document_bcs.
data recipient type ref to if_recipient_bcs.
data bcs_exception type ref to cx_bcs.
data sent_to_all type os_boolean.
data adresse type ADR6-SMTP_ADDR.
data mailflag(1) value space.
data dat(10).
data time(10).
data tfree(12).
write sy-datum to dat.
write sy-uzeit to time.
*subject
subject = 'This is my Subject '.
line = ' I am the body of the message '.
append line to text.
*Mail Send Mail out to external Mail Server .
try.
*create the send request
send_request = cl_bcs=>create_persistent( ).
document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = text
i_subject = 'Hi this is my subject' ).
*add document to send request
send_request->set_document( document ).
*create recipient and add to send request
adresse = 'twinklezz2004@yahoo.co.in'.
recipient = cl_cam_address_bcs=>create_internet_address(
adresse ).
send_request->add_recipient( i_recipient = recipient ).
*send mail now
sent_to_all = send_request->send( i_with_error_screen = 'X' ).
if sent_to_all = 'X'.
Message s022(so).
Endif.
catch cx_bcs into bcs_exception.
message e865(so) with bcs_exception->error_type.
endtry.
*Close Transaction.
commit work.
*End of the Code.
*End of the Code.
11-30-2007 10:52 AM
Thanks for replying Mahesh .
I tried using the code u sent .. I had tried using BCS earlier .. but unfortunately it does create a copy in sost and I could view the contents of mail as well.
11-30-2007 1:55 PM
thanks for all ur help . I have found a temp. solution so should be fine