<?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 Mail Problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/mail-problem/m-p/1159674#M120046</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 am working with the function module&lt;/P&gt;&lt;P&gt;SO_NEW_DOCUMENT_SEND_API1 and facing the following pblm.&lt;/P&gt;&lt;P&gt;With this function module the mail is send to receivers of&lt;/P&gt;&lt;P&gt;type 'B' (SAP Users) and not of type 'U'. What might be the problem.&lt;/P&gt;&lt;P&gt;Note : When I checked the SCOT transaction I could find some work processes in Wait state for a long period of time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me to resolve this issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Mathi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Feb 2006 08:28:37 GMT</pubDate>
    <dc:creator>kanthimathikris</dc:creator>
    <dc:date>2006-02-15T08:28:37Z</dc:date>
    <item>
      <title>Mail Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mail-problem/m-p/1159674#M120046</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 am working with the function module&lt;/P&gt;&lt;P&gt;SO_NEW_DOCUMENT_SEND_API1 and facing the following pblm.&lt;/P&gt;&lt;P&gt;With this function module the mail is send to receivers of&lt;/P&gt;&lt;P&gt;type 'B' (SAP Users) and not of type 'U'. What might be the problem.&lt;/P&gt;&lt;P&gt;Note : When I checked the SCOT transaction I could find some work processes in Wait state for a long period of time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me to resolve this issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Mathi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2006 08:28:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mail-problem/m-p/1159674#M120046</guid>
      <dc:creator>kanthimathikris</dc:creator>
      <dc:date>2006-02-15T08:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: Mail Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mail-problem/m-p/1159675#M120047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kanthimathi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chk out this sample code and let me know if its working:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  ZSENDEMAIL                                                  *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Example of sending external email via SAPCONNECT                    *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*
REPORT  zsendemail                    .

PARAMETERS: psubject(40) type c default  'Testing',
            p_email(40)   type c default 'anjali.devi@wipro.com'.

data:   it_packing_list like sopcklsti1 occurs 0 with header line,
        it_contents like solisti1 occurs 0 with header line,
        it_receivers like somlreci1 occurs 0 with header line,
        it_attachment like solisti1 occurs 0 with header line,
        gd_cnt type i,
        gd_sent_all(1) type c,
        gd_doc_data like sodocchgi1,
        gd_error type sy-subrc.

data:   it_message type standard table of SOLISTI1 initial size 0
                with header line.

***********************************************************************
*START-OF-SELECTION.
START-OF-SELECTION.

Perform populate_message_table.

*Send email message, although is not sent from SAP until mail send
*program has been executed(rsconn01)
PERFORM send_email_message.

*Instructs mail send program for SAPCONNECT to send email(rsconn01)
perform initiate_mail_execute_program.


*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  POPULATE_MESSAGE_TABLE
*&amp;amp;---------------------------------------------------------------------*
*       Adds text to email text table
*----------------------------------------------------------------------*
form populate_message_table.
  Append 'Line1' to it_message.
  Append 'Line2' to it_message.
  Append 'Line3' to it_message.
  Append 'Test- 1' to it_message.
endform.                    " POPULATE_MESSAGE_TABLE


*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  SEND_EMAIL_MESSAGE
*&amp;amp;---------------------------------------------------------------------*
*       Send email message
*----------------------------------------------------------------------*
form send_email_message.
* Fill the document data.
  gd_doc_data-doc_size = 1.

* Populate the subject/generic message attributes
  gd_doc_data-obj_langu = sy-langu.
  gd_doc_data-obj_name  = 'SAPRPT'.
  gd_doc_data-obj_descr = psubject.
  gd_doc_data-sensitivty = 'F'.

* Describe the body of the message
* Information about structure of data tables
  clear it_packing_list.
  refresh it_packing_list.
  it_packing_list-transf_bin = space.
  it_packing_list-head_start = 1.
  it_packing_list-head_num = 0.
  it_packing_list-body_start = 1.
  describe table it_message lines it_packing_list-body_num.
  it_packing_list-doc_type = 'RAW'.
  append it_packing_list.

* Add the recipients email address
  clear it_receivers.
  refresh it_receivers.
  it_receivers-receiver = p_email.
  it_receivers-rec_type = 'U'.
  append it_receivers.

* Call the FM to post the message to SAPMAIL
  call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
       exporting
            document_data              = gd_doc_data
            put_in_outbox              = 'X'
       importing
            sent_to_all                = gd_sent_all
       tables
            packing_list               = it_packing_list
            contents_txt               = it_message
            receivers                  = it_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.

* Store function module return code
  gd_error = sy-subrc.

* Get it_receivers return code
  loop at it_receivers.
  endloop.
endform.                    " SEND_EMAIL_MESSAGE


*&amp;amp;---------------------------------------------------------------------
*&amp;amp;      Form  INITIATE_MAIL_EXECUTE_PROGRAM
*&amp;amp;---------------------------------------------------------------------
*       Instructs mail send program for SAPCONNECT to send email.
*----------------------------------------------------------------------

form initiate_mail_execute_program.
  wait up to 2 seconds.
  if gd_error eq 0.
      submit rsconn01 with mode = 'INT'
                    with output = 'X'
                    and return.
  endif.
endform.                    " INITIATE_MAIL_EXECUTE_PROGRAM
*

http://www.sap-img.com/fu016.htm

The above codes will work fine if your mail sending configurations are set properly. Please contact the basis team for help on this.

Also, please let us know the error thats being displayed currently.

Best Regards,
Anjali
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2006 08:32:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mail-problem/m-p/1159675#M120047</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-15T08:32:31Z</dc:date>
    </item>
    <item>
      <title>Re: Mail Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mail-problem/m-p/1159676#M120048</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;What is the problem you are facing?&lt;/P&gt;&lt;P&gt;Did u checked the sy-subrc after the FM?&lt;/P&gt;&lt;P&gt;Is it showing zero?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2006 08:34:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mail-problem/m-p/1159676#M120048</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2006-02-15T08:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: Mail Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mail-problem/m-p/1159677#M120049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you trying to send external mail?.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Karun M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2006 11:15:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mail-problem/m-p/1159677#M120049</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-15T11:15:22Z</dc:date>
    </item>
    <item>
      <title>Re: Mail Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mail-problem/m-p/1159678#M120050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi krishnan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the problem might me 1 of these as under:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. In the exporting parameters of..FM use&lt;/P&gt;&lt;P&gt; commit_work            = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Check for Sy-subrc of FM..&lt;/P&gt;&lt;P&gt;   if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;    SUBMIT rsconn01&lt;/P&gt;&lt;P&gt;    WITH mode EQ 'INT'&lt;/P&gt;&lt;P&gt;    AND RETURN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;this report program is used to automatically send the e-mails that are pending in the job queue.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ELSE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. U may have some SMTP Config. problem.&lt;/P&gt;&lt;P&gt;   If so u can ask me for details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Else send ur code what u r using.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-------------" /&gt;&lt;P&gt;Sachin Dhingra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2006 12:33:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mail-problem/m-p/1159678#M120050</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-15T12:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: Mail Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mail-problem/m-p/1159679#M120051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sachin,&lt;/P&gt;&lt;P&gt;  Thanks for the input.&lt;/P&gt;&lt;P&gt;  I have added the code what you have given.&lt;/P&gt;&lt;P&gt;Still facing the same problem.&lt;/P&gt;&lt;P&gt;Here goes my code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    RECLIST-RECEIVER = 'ssushak@yahoo.com'.&lt;/P&gt;&lt;P&gt;    RECLIST-REC_TYPE = 'U'.&lt;/P&gt;&lt;P&gt;    RECLIST-EXPRESS = 'X'.&lt;/P&gt;&lt;P&gt;    APPEND RECLIST.&lt;/P&gt;&lt;P&gt;&lt;/P&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_TYPE              = 'RAW'&lt;/P&gt;&lt;P&gt;    DOCUMENT_DATA              = DOC_CHNG&lt;/P&gt;&lt;P&gt;    PUT_IN_OUTBOX              = 'X'&lt;/P&gt;&lt;P&gt;    COMMIT_WORK                = 'X'&lt;/P&gt;&lt;P&gt;  TABLES&lt;/P&gt;&lt;P&gt;    OBJECT_CONTENT             = OBJCONT&lt;/P&gt;&lt;P&gt;    RECEIVERS                  = 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;    OPERATION_NO_AUTHORIZATION = 4&lt;/P&gt;&lt;P&gt;    OTHERS                     = 99.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    SUBMIT rsconn01&lt;/P&gt;&lt;P&gt;    WITH mode EQ 'INT'&lt;/P&gt;&lt;P&gt;    AND RETURN.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2006 12:47:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mail-problem/m-p/1159679#M120051</guid>
      <dc:creator>kanthimathikris</dc:creator>
      <dc:date>2006-02-15T12:47:20Z</dc:date>
    </item>
    <item>
      <title>Re: Mail Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mail-problem/m-p/1159680#M120052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sachin,&lt;/P&gt;&lt;P&gt;  Thanks for the input.&lt;/P&gt;&lt;P&gt;  I have added the code what you have given.&lt;/P&gt;&lt;P&gt;Still facing the same problem.&lt;/P&gt;&lt;P&gt;Here goes my code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    RECLIST-RECEIVER = 'ssushak@yahoo.com'.&lt;/P&gt;&lt;P&gt;    RECLIST-REC_TYPE = 'U'.&lt;/P&gt;&lt;P&gt;    RECLIST-EXPRESS = 'X'.&lt;/P&gt;&lt;P&gt;    APPEND RECLIST.&lt;/P&gt;&lt;P&gt;&lt;/P&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_TYPE              = 'RAW'&lt;/P&gt;&lt;P&gt;    DOCUMENT_DATA              = DOC_CHNG&lt;/P&gt;&lt;P&gt;    PUT_IN_OUTBOX              = 'X'&lt;/P&gt;&lt;P&gt;    COMMIT_WORK                = 'X'&lt;/P&gt;&lt;P&gt;  TABLES&lt;/P&gt;&lt;P&gt;    OBJECT_CONTENT             = OBJCONT&lt;/P&gt;&lt;P&gt;    RECEIVERS                  = 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;    OPERATION_NO_AUTHORIZATION = 4&lt;/P&gt;&lt;P&gt;    OTHERS                     = 99.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    SUBMIT rsconn01&lt;/P&gt;&lt;P&gt;    WITH mode EQ 'INT'&lt;/P&gt;&lt;P&gt;    AND RETURN.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2006 12:49:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mail-problem/m-p/1159680#M120052</guid>
      <dc:creator>kanthimathikris</dc:creator>
      <dc:date>2006-02-15T12:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: Mail Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mail-problem/m-p/1159681#M120053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wanted to add few things..&lt;/P&gt;&lt;P&gt;When I opened my mail server today, I got all the mails sent yesterday..it nearly took more than 7 hrs for sending the mails.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note :&lt;/P&gt;&lt;P&gt;I explicitly forced the mail sending thro' the transaction&lt;/P&gt;&lt;P&gt;SOST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I make the process faster?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2006 04:01:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mail-problem/m-p/1159681#M120053</guid>
      <dc:creator>kanthimathikris</dc:creator>
      <dc:date>2006-02-16T04:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: Mail Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mail-problem/m-p/1159682#M120054</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;wait up to 2 seconds.&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;submit rsconn01 with mode = 'INT'&lt;/P&gt;&lt;P&gt;with output = 'X'&lt;/P&gt;&lt;P&gt;and return.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check whether it is placed in outbox after this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Jayanthi Jayaraman&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2006 04:23:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mail-problem/m-p/1159682#M120054</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2006-02-16T04:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: Mail Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mail-problem/m-p/1159683#M120055</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;There might be some SMTP problem yesterday, now the problem is solved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mathi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2006 04:32:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mail-problem/m-p/1159683#M120055</guid>
      <dc:creator>kanthimathikris</dc:creator>
      <dc:date>2006-02-16T04:32:26Z</dc:date>
    </item>
  </channel>
</rss>

