‎2005 Apr 15 8:55 PM
Hi All,
Is there a Function Module in R/3 that can send external emails?
Thanks!
Roman D.
‎2005 Apr 15 9:02 PM
Roman,
Use FM SO_OBJECT_SEND.
The FM is used extensively in SAP and finding examples should be easy.
Rishi
‎2005 Apr 15 9:05 PM
‎2005 Apr 16 2:06 AM
I usually use the following function module. I believe that it eventually calls the function module mentioned in the previous post. Here is a sample program.
report zrich_0003 .
data: maildata type sodocchgi1.
data: mailtxt type table of solisti1 with header line.
data: mailrec type table of somlrec90 with header line.
start-of-selection.
clear: maildata, mailtxt, mailrec.
refresh: mailtxt, mailrec.
maildata-obj_name = 'TEST'.
maildata-obj_descr = 'Test'.
maildata-obj_langu = sy-langu.
mailtxt-line = 'This is a test'.
append mailtxt.
mailrec-receiver = 'someone@somewhere.com'.
mailrec-rec_type = 'U'.
append mailrec.
call function 'SO_NEW_DOCUMENT_SEND_API1'
exporting
document_data = maildata
document_type = 'RAW'
put_in_outbox = 'X'
tables
object_header = mailtxt
object_content = mailtxt
receivers = mailrec
exceptions
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
others = 8.
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
Regards,
Rich Heilman
‎2005 May 13 10:09 AM
Hi Rich,
I tried to send a mail to my external mail box using the code segment you have given. But I didn't receive the mail which I had send. Could you please tell me whether I need to do any configuration or something like that for this program to work
‎2005 May 13 10:34 AM
Hi Prajesh,
so what's your problem exactly ?
you'll send mail from SAP to outlook / webmail ?
-> so look <b>weblog</b> of Thomas Jung:
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
exporting
document_data = doc_chng
put_in_outbox = 'X'
tables
packing_list = objpack
object_header = objhead
contents_bin = html_tab
contents_txt = objtxt
receivers = reclist...
regards Andreas
‎2005 May 13 10:46 AM
Hi Andreas,
exactly i want to send mail from SAP to outlook or any other external mail system.could you please tell me what are all things I should taken care?
‎2005 May 13 3:32 PM
Hi Prajesh,
Have you configured SAP to talk to an external mail system?
You can do this using SAPConnect (transaction SCOT).
You will need to set up an internet node (you can connect to the mail server using RFC, and also HTTP from 6.2 onwards).
Once you have done this, you will be able to send mail to your outlook.
To look at your 'stuck' messages (the ones that you have sent, but which have not gone anywhere), run transaction SOST.
Cheers,
Brad
‎2005 Apr 16 2:11 AM
Rich is right. You should use SO_NEW_DOCUMENT_SEND_API1 or SO_NEW_DOCUMENT_ATT_SEND_API1 if you want to send attachments along with the mail. These modules are released for customer use and have very good documentation.
Also please see the Weblogs mentioned below:
Sending E-Mail from ABAP - Version 610 and Higher - BCS Interface: /people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface
Sending E-Mail from ABAP - Version 46D and Lower - API Interface: /people/thomas.jung3/blog/2004/09/07/sending-e-mail-from-abap--version-46d-and-lower--api-interface
Cheers,
Ramki.
‎2005 Jul 08 9:56 AM
Using call function "SO_NEW_DOCUMENT_ATT_SEND_API1" in specific program in SAP R/3, i would like to know if it is possible to send a mail on Outlook webmail box in 4.0B Version of SAP?
Regards, Vincent
‎2005 Jul 08 6:50 PM
Roman;
Try adding this section of code to the end of Rich's example:
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = 'X'
EXPORTING LIST TO MEMORY
AND RETURN.
If that doesn't work, I concur with Brad that there may be a problem that you can track down in transactions SCOT or SOST.
-John