Application Development and Automation 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: 
Read only

Function module to send mails to outlook

Former Member
0 Likes
944

Hi All,

Can you let me know if there is an FM to send mails to the OUTLOOK. Also let me know what parameters need to be passed to the FM.

I need to send mails to the individual and also to the user group.

Regards

Shiva

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
706

Hi Shiva,

Refer this sample program to send mails.

http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm

Best regards,

Prashant

5 REPLIES 5
Read only

Former Member
0 Likes
706

check this function module

using this you can send mails

'SO_DOCUMENT_SEND_API1'

Read only

Former Member
0 Likes
707

Hi Shiva,

Refer this sample program to send mails.

http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm

Best regards,

Prashant

Read only

Former Member
0 Likes
706

HI Check the usage of the FM..

DATA: ls_docudata LIKE sodocchgi1,

lt_packlist LIKE sopcklsti1 OCCURS 0,

ls_packlist LIKE LINE OF lt_packlist,

lt_text LIKE solisti1 OCCURS 0,

ls_text LIKE LINE OF lt_text,

l_sender LIKE soextreci1-receiver,

l_tab_lines LIKE sy-tabix.

DATA: lt_receivers LIKE somlreci1 OCCURS 0,

ls_receivers LIKE LINE OF lt_receivers.

  • Mail properties

ls_docudata-obj_descr = 'Achtung mlicher Datenschiefstand'(m01).

ls_docudata-obj_langu = sy-langu.

ls_docudata-sensitivty = 'F'.

ls_docudata-no_change = ' '.

ls_docudata-obj_prio = '1'.

ls_docudata-proc_type = 'F'.

ls_docudata-proc_name = 'RKE_START_ERROR_KF631'.

ls_docudata-free_del = 'X'.

  • Sender

l_sender = sy-uname.

  • Receiver

ls_receivers-receiver = sy-uname.

ls_receivers-rec_type = 'B'.

ls_receivers-express = 'X'.

APPEND ls_receivers TO lt_receivers.

  • Text

ls_text = text-m02. " F・ weitere Informationen w臧len ...

APPEND ls_text TO lt_text.

DESCRIBE TABLE lt_text LINES l_tab_lines.

  • Document properties

ls_packlist-body_start = 1.

ls_packlist-body_num = l_tab_lines.

ls_packlist-doc_type = 'RAW'.

APPEND ls_packlist TO lt_packlist.

  • Send mail

CALL FUNCTION 'SO_DOCUMENT_SEND_API1'

EXPORTING

document_data = ls_docudata

sender_address = l_sender

sender_address_type = 'B'

TABLES

packing_list = lt_packlist

contents_txt = lt_text

receivers = lt_receivers

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.

Praveen.

Hope it Helps .

Read only

0 Likes
706

Hi Praveen,

I had the same problem. Now I am able to send the mail notification to the SAP Business Workplace. But its not working for a Internet address, like say, asd@gmail.com or asd@sss.com. Is there any configuration need to be done to be able to send mails to Internet addresses.

There is a message in the Business Workplace recipient list which shows that, 'Wait for Communication services.'

Please let me know if any connectivity configurations need to be done.

Thanks and regards

Read only

0 Likes
706

Hi,

Can you check in transaction SOST whether the mail has gone till there or not. If it is there in SOST you need to process from there. If you could not process from there, basis people needs to configure SMTP server and has to open the mail Gateway to send mails externally.

Reward if it helps,

Satish