<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Function Module to send a mail in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-send-a-mail/m-p/2112702#M441813</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a pdf file. I need to send this pdf file through mail by using a program. Can anybody tell what is the function module used for this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Apr 2007 10:20:20 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-04-19T10:20:20Z</dc:date>
    <item>
      <title>Function Module to send a mail</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-send-a-mail/m-p/2112702#M441813</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a pdf file. I need to send this pdf file through mail by using a program. Can anybody tell what is the function module used for this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Apr 2007 10:20:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-send-a-mail/m-p/2112702#M441813</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-19T10:20:20Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module to send a mail</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-send-a-mail/m-p/2112703#M441814</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;use the fun module&lt;/P&gt;&lt;P&gt;SO_NEW_DOCUMENT_ATT_SEND_API1'&lt;/P&gt;&lt;P&gt;reward if useful&lt;/P&gt;&lt;P&gt;regards,.&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Apr 2007 10:21:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-send-a-mail/m-p/2112703#M441814</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-19T10:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module to send a mail</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-send-a-mail/m-p/2112704#M441815</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use this function SO_NEW_DOCUMENT_ATT_SEND_API1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Victor.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Apr 2007 10:22:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-send-a-mail/m-p/2112704#M441815</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-19T10:22:11Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module to send a mail</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-send-a-mail/m-p/2112705#M441816</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chekc this program it may help u.&lt;/P&gt;&lt;P&gt;FORM send_mail USING p_y16m_rcp_par STRUCTURE y16m_rcp_par.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Have a subject for the mail&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;g_s_document_data-obj_name = text-t02.&lt;/P&gt;&lt;P&gt;g_s_document_data-obj_descr = text-t03.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Fill receiver information&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;g_s_receivers-rec_type = p_y16m_rcp_par-rec_type.&lt;/P&gt;&lt;P&gt;g_s_receivers-rec_id = p_y16m_rcp_par-rec_id.&lt;/P&gt;&lt;P&gt;g_s_receivers-express = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND g_s_receivers TO g_t_receivers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Call function to send mail&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;document_data = g_s_document_data&lt;/P&gt;&lt;P&gt;document_type = 'RAW'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;PUT_IN_OUTBOX = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;SENT_TO_ALL =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;NEW_OBJECT_ID =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;OBJECT_HEADER =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;object_content = g_t_object_content&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CONTENTS_HEX =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;OBJECT_PARA =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;OBJECT_PARB =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;receivers = g_t_receivers&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;too_many_receivers = 1&lt;/P&gt;&lt;P&gt;document_not_sent = 2&lt;/P&gt;&lt;P&gt;document_type_not_exist = 3&lt;/P&gt;&lt;P&gt;operation_no_authorization = 4&lt;/P&gt;&lt;P&gt;parameter_error = 5&lt;/P&gt;&lt;P&gt;x_error = 6&lt;/P&gt;&lt;P&gt;enqueue_error = 7&lt;/P&gt;&lt;P&gt;OTHERS = 8&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM. " SEND_MAIL&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Simha.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if helpful..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Apr 2007 10:22:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-send-a-mail/m-p/2112705#M441816</guid>
      <dc:creator>Simha_</dc:creator>
      <dc:date>2007-04-19T10:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module to send a mail</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-send-a-mail/m-p/2112706#M441817</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you can use this FM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SO_NEW_DOCUMENT_ATT_SEND_API1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This function module enables you send a new document including any existing attachments. The document and the attachments are transferred in the same table. They are created when sent and can also be placed in the sender's outbox.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rewards if useful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;nazeer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Apr 2007 10:23:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-send-a-mail/m-p/2112706#M441817</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-19T10:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module to send a mail</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-send-a-mail/m-p/2112707#M441818</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;chk this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm" target="test_blank"&gt;http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds&lt;/P&gt;&lt;P&gt;Reshma&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Apr 2007 10:23:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-send-a-mail/m-p/2112707#M441818</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-19T10:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module to send a mail</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-send-a-mail/m-p/2112708#M441819</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi rajesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the FM &amp;lt;b&amp;gt;SO_NEW_DOCUMENT_ATT_SEND_API1&amp;lt;/b&amp;gt; to send Email .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you call the smartform FM, you can get the OTF data in a tables parameter.&lt;/P&gt;&lt;P&gt;You can convert the OTF data into PDF data using the function module.&lt;/P&gt;&lt;P&gt;CONVERT_OTF_2_PDF or SX_OBJECT_CONVERT_OTF_PDF&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;then you can build the attachment and send a mail using the FM:&lt;/P&gt;&lt;P&gt;SO_NEW_DOCUMENT_ATT_SEND_API1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this resolves your query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward all the helpful answers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Apr 2007 10:25:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-send-a-mail/m-p/2112708#M441819</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-19T10:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module to send a mail</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-send-a-mail/m-p/2112709#M441820</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;refer this threads:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*******************************&lt;/P&gt;&lt;P&gt;The below sample code is for 4.6C.Try this out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Internal Table declarations&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: i_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;i_tline TYPE TABLE OF tline WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;i_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Objects to send mail.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;i_objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;i_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;i_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;i_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Work Area declarations&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;wa_objhead TYPE soli_tab,&lt;/P&gt;&lt;P&gt;w_ctrlop TYPE ssfctrlop,&lt;/P&gt;&lt;P&gt;w_compop TYPE ssfcompop,&lt;/P&gt;&lt;P&gt;w_return TYPE ssfcrescl,&lt;/P&gt;&lt;P&gt;wa_doc_chng typE sodocchgi1,&lt;/P&gt;&lt;P&gt;w_data TYPE sodocchgi1,&lt;/P&gt;&lt;P&gt;wa_buffer TYPE string,"To convert from 132 to 255&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Variables declarations&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;v_form_name TYPE rs38l_fnam,&lt;/P&gt;&lt;P&gt;v_len_in LIKE sood-objlen,&lt;/P&gt;&lt;P&gt;v_len_out LIKE sood-objlen,&lt;/P&gt;&lt;P&gt;v_len_outn TYPE i,&lt;/P&gt;&lt;P&gt;v_lines_txt TYPE i,&lt;/P&gt;&lt;P&gt;v_lines_bin TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function 'SSF_FUNCTION_MODULE_NAME'&lt;/P&gt;&lt;P&gt;exporting&lt;/P&gt;&lt;P&gt;formname = 'ZZZ_TEST1'&lt;/P&gt;&lt;P&gt;importing&lt;/P&gt;&lt;P&gt;fm_name = v_form_name&lt;/P&gt;&lt;P&gt;exceptions&lt;/P&gt;&lt;P&gt;no_form = 1&lt;/P&gt;&lt;P&gt;no_function_module = 2&lt;/P&gt;&lt;P&gt;others = 3.&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;w_ctrlop-getotf = 'X'.&lt;/P&gt;&lt;P&gt;w_ctrlop-no_dialog = 'X'.&lt;/P&gt;&lt;P&gt;w_compop-tdnoprev = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION v_form_name&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;control_parameters = w_ctrlop&lt;/P&gt;&lt;P&gt;output_options = w_compop&lt;/P&gt;&lt;P&gt;user_settings = 'X'&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;job_output_info = w_return&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;formatting_error = 1&lt;/P&gt;&lt;P&gt;internal_error = 2&lt;/P&gt;&lt;P&gt;send_error = 3&lt;/P&gt;&lt;P&gt;user_canceled = 4&lt;/P&gt;&lt;P&gt;OTHERS = 5.&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i_otf[] = w_return-otfdata[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function 'CONVERT_OTF'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;format = 'PDF'&lt;/P&gt;&lt;P&gt;max_linewidth = 132&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;bin_filesize = v_len_in&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;otf = i_otf&lt;/P&gt;&lt;P&gt;lines = i_tline&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;err_max_linewidth = 1&lt;/P&gt;&lt;P&gt;err_format = 2&lt;/P&gt;&lt;P&gt;err_conv_not_possible = 3&lt;/P&gt;&lt;P&gt;others = 4.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Fehlerhandling&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at i_tline.&lt;/P&gt;&lt;P&gt;translate i_tline using '~'.&lt;/P&gt;&lt;P&gt;concatenate wa_buffer i_tline into wa_buffer.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;translate wa_buffer using '~'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do.&lt;/P&gt;&lt;P&gt;i_record = wa_buffer.&lt;/P&gt;&lt;P&gt;append i_record.&lt;/P&gt;&lt;P&gt;shift wa_buffer left by 255 places.&lt;/P&gt;&lt;P&gt;if wa_buffer is initial.&lt;/P&gt;&lt;P&gt;exit.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Attachment&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;refresh:&lt;/P&gt;&lt;P&gt;i_reclist,&lt;/P&gt;&lt;P&gt;i_objtxt,&lt;/P&gt;&lt;P&gt;i_objbin,&lt;/P&gt;&lt;P&gt;i_objpack.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear wa_objhead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i_objbin[] = i_record[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="7" type="ul"&gt;&lt;P&gt;Create Message Body&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;LI level="4" type="ul"&gt;&lt;P&gt;Title and Description&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;i_objtxt = 'test with pdf-Attachment!'.&lt;/P&gt;&lt;P&gt;append i_objtxt.&lt;/P&gt;&lt;P&gt;describe table i_objtxt lines v_lines_txt.&lt;/P&gt;&lt;P&gt;read table i_objtxt index v_lines_txt.&lt;/P&gt;&lt;P&gt;wa_doc_chng-obj_name = 'smartform'.&lt;/P&gt;&lt;P&gt;wa_doc_chng-expiry_dat = sy-datum + 10.&lt;/P&gt;&lt;P&gt;wa_doc_chng-obj_descr = 'smartform'.&lt;/P&gt;&lt;P&gt;wa_doc_chng-sensitivty = 'F'.&lt;/P&gt;&lt;P&gt;wa_doc_chng-doc_size = v_lines_txt * 255.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="4" type="ul"&gt;&lt;P&gt;Main Text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;wa_doc_chng-doc_size = ( v_lines_txt - 1 ) * 255 + strlen( i_objtxt )&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*.&lt;/P&gt;&lt;P&gt;clear i_objpack-transf_bin.&lt;/P&gt;&lt;P&gt;i_objpack-head_start = 1.&lt;/P&gt;&lt;P&gt;i_objpack-head_num = 0.&lt;/P&gt;&lt;P&gt;i_objpack-body_start = 1.&lt;/P&gt;&lt;P&gt;i_objpack-body_num = v_lines_txt.&lt;/P&gt;&lt;P&gt;i_objpack-doc_type = 'RAW'.&lt;/P&gt;&lt;P&gt;append i_objpack.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="4" type="ul"&gt;&lt;P&gt;Attachment&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;(pdf-Attachment)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;i_objpack-transf_bin = 'X'.&lt;/P&gt;&lt;P&gt;i_objpack-head_start = 1.&lt;/P&gt;&lt;P&gt;i_objpack-head_num = 0.&lt;/P&gt;&lt;P&gt;i_objpack-body_start = 1.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Länge des Attachment ermitteln&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;describe table i_objbin lines v_lines_bin.&lt;/P&gt;&lt;P&gt;read table i_objbin index v_lines_bin.&lt;/P&gt;&lt;P&gt;i_objpack-doc_size = v_lines_bin * 255 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i_objpack-body_num = v_lines_bin.&lt;/P&gt;&lt;P&gt;i_objpack-doc_type = 'PDF'.&lt;/P&gt;&lt;P&gt;i_objpack-obj_name = 'smart'.&lt;/P&gt;&lt;P&gt;i_objpack-obj_descr = 'test'.&lt;/P&gt;&lt;P&gt;append i_objpack.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear i_reclist.&lt;/P&gt;&lt;P&gt;i_reclist-receiver = xyz@yahoo.com'.&lt;/P&gt;&lt;P&gt;i_reclist-rec_type = 'U'.&lt;/P&gt;&lt;P&gt;append i_reclist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;document_data = wa_doc_chng&lt;/P&gt;&lt;P&gt;put_in_outbox = 'X'&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;packing_list = i_objpack&lt;/P&gt;&lt;P&gt;object_header = wa_objhead&lt;/P&gt;&lt;P&gt;CONTENTS_BIN = i_objbin&lt;/P&gt;&lt;P&gt;contents_txt = i_objtxt&lt;/P&gt;&lt;P&gt;receivers = i_reclist&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;too_many_receivers = 1&lt;/P&gt;&lt;P&gt;document_not_sent = 2&lt;/P&gt;&lt;P&gt;document_type_not_exist = 3&lt;/P&gt;&lt;P&gt;operation_no_authorization = 4&lt;/P&gt;&lt;P&gt;parameter_error = 5&lt;/P&gt;&lt;P&gt;x_error = 6&lt;/P&gt;&lt;P&gt;enqueue_error = 7&lt;/P&gt;&lt;P&gt;others = 8.&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;Kindly reward points by clicking the star on the left of reply,if it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;prssastry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Apr 2007 10:27:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-send-a-mail/m-p/2112709#M441820</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-19T10:27:46Z</dc:date>
    </item>
  </channel>
</rss>

