cancel
Showing results for 
Search instead for 
Did you mean: 

How to send a mail to more than one mail Id

Former Member
0 Kudos

Hi All,

I would like to mark more than one mail Id in the 'To' list of a workitem(mail). Please let me know how can this be done. Also please let me know if there is an option of 'CC' in workflow mails.

Thanks,

Sirisha N.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member183878
Active Participant
0 Kudos

if you using triging mail in CRM, u can use action using method call option ,use BADI "EXEC_METHODCALL_PPF"

,populate email id use uour own logic.use following code

CALL FUNCTION 'CRM_ORDER_READ'

EXPORTING

it_header_guid = lt_header_guid

iv_mode = gc_mode-display

it_requested_objects = lt_req_objects

IMPORTING

et_partner = lt_partner

EXCEPTIONS

document_not_found = 1

error_occurred = 2

document_locked = 3

no_change_authority = 4

no_display_authority = 5

no_change_allowed = 6

OTHERS = 7.

LOOP AT lt_partner INTO ls_partner .

CLEAR wa_adr6 .

SELECT SINGLE * FROM adr6 INTO wa_adr6 WHERE addrnumber = ls_partner-addr_nr

AND persnumber = ls_partner-addr_np.

CLEAR wa_receivers.

wa_receivers-receiver = wa_adr6-smtp_addr.

wa_receivers-rec_type = 'U'.

wa_receivers-com_type = 'INT'.

APPEND wa_receivers TO receivers.

ENDLOOP.

use following code for eamil send

*DATA: lr_mail_data TYPE REF TO cl_crm_email_data.

*DATA: lv_to TYPE crms_email_recipient_data.

*DATA: lv_from TYPE crms_email_recipient_data.

*DATA: ls_struc_mail TYPE crms_email_mime_struc.

*DATA: lv_send_request TYPE sysuuid_x.

*DATA: et_text TYPE soli_tab,

l_text TYPE string.

*- create mail object

*CREATE OBJECT lr_mail_data.

*- Email subject

*lr_mail_data->subject = 'Some subject'.

*- To recipient CC

*lv_to-address = 'vxxxxxxxxx.com'.

*lv_to-name = 'xxxx'.

*APPEND lv_to-address_part TO lr_mail_data->copy.

*- To recipient BCC

*lv_to-address = 'vxxxxxxxxx.com'.

*lv_to-name = 'xxxx'.

*APPEND lv_to-address_part TO lr_mail_data-bcc.

*- To recipient (may be more)

*lv_to-address = 'vxxxxxxxxx.com'.

*lv_to-name = 'xxxx'.

*APPEND lv_to-address_part TO lr_mail_data->to.

*- From recipient

*MOVE 'SAP CRM <someserversomemailcom>' TO lv_from-address.

*MOVE 'SAP CRM <someserversomemailom>' TO lv_from-name.

*MOVE 'SAP CRM <someserversomemail.om>' TO lv_from-id.

*lr_mail_data->from = lv_from-address_part.

*APPEND '<html>' TO et_text.

*APPEND '<body >' TO et_text.

*APPEND '</body>' TO et_text.

*APPEND '</html>' TO et_text.

*CALL FUNCTION 'SOTR_SERV_TABLE_TO_STRING'

EXPORTING

flag_no_line_breaks = 'X'

line_length = 9999999

langu = sy-langu

IMPORTING

text = l_text

TABLES

text_tab = et_text.

CLEAR ls_struc_mail-content_ascii.

*- Email Body (HTML)

MOVE 'text/html' TO ls_struc_mail-mime_type.

MOVE 'body.htm' TO ls_struc_mail-file_name.

MOVE l_text TO ls_struc_mail-content_ascii.

APPEND ls_struc_mail TO lr_mail_data->body.

**- Send Email

lv_send_request = cl_crm_email_utility=>send_email( iv_mail_data = lr_mail_data ).

Edited by: vijay khandare on May 13, 2011 12:36 PM

Edited by: vijay khandare on May 13, 2011 12:38 PM