Send Email to list of users

Hi All,
I need to develop a program which is a report but need to send the report output in email to the customers.Till report output i could develop the program but i want to know how to send this report output in email to the list of user.Can anybody help me on this?Example code will be more useful.
Thanks
Sai

Below code can help as reference as well:
PARAMETERS: p_mail TYPE ad_smtpadr OBLIGATORY.
DATA: i_mara TYPE STANDARD TABLE OF mara.  " MARA Entries
DATA: l_text TYPE char255.  " Text
DATA: l_lines TYPE i,
      l_size            TYPE           sood-objlen.
" Size of Attachment
* Mail related
DATA: i_content         TYPE   soli_tab, " Mail content
      i_attach          TYPE   soli_tab. " Attachment
DATA: l_send_request    TYPE REF TO    cl_bcs,
                                            " E-Mail Send Request
      l_document        TYPE REF TO    cl_document_bcs,
                                            " E-Mail Attachment
      l_recipient       TYPE REF TO    if_recipient_bcs,
                                            " Distribution List
      l_sender          TYPE REF TO    if_sender_bcs,
                                            " Address of Sender
      l_uname           TYPE           salrtdrcpt,
                                            " Sender Name(SY-UNAME)
      l_bcs_exception   TYPE REF TO    cx_document_bcs,
                                            " BCS Exception
      l_addr_exception  TYPE REF TO    cx_address_bcs,
                                            " Address Exception
      l_send_exception  TYPE REF TO    cx_send_req_bcs.
" E-Mail sending Exception
*Constants------------------------------------------------------------*
CONSTANTS: c_tab(1) TYPE c VALUE
               cl_abap_char_utilities=>horizontal_tab,
                                     " Tab Character
           c_cr(1)  TYPE c VALUE cl_abap_char_utilities=>cr_lf,
                                     " Line Feed for End-Of_line
           c_ext    TYPE soodk-objtp VALUE 'XLS'. " XLS Extension
START-OF-SELECTION.
  SELECT * FROM mara INTO TABLE i_mara UP TO 20 ROWS.
* Preparing body of the Mail
  MOVE 'Mail Body' TO l_text.
  APPEND l_text TO i_content.
* Preparing contents of attachment with Change Log
  PERFORM prepare_attachment.
* Creates persistent send request
  TRY.
      l_send_request = cl_bcs=>create_persistent( ).
* Creating Document
      l_document = cl_document_bcs=>create_document(
                                    i_type  = 'RAW'
                                    i_text  = i_content[]
                                    i_subject = 'Material Details' ).
      DESCRIBE TABLE i_mara LINES l_lines.
* Size to multiplied by 2 for UNICODE enabled systems
      l_size = l_lines * 2 * 255.
* Adding Attachment
      CALL METHOD l_document->add_attachment
        EXPORTING
          i_attachment_type    = c_ext
          i_attachment_size    = l_size
          i_attachment_subject = 'Material Details'
          i_att_content_text   = i_attach[].
* Add document to send request
      CALL METHOD l_send_request->set_document( l_document ).
* Get Sender Object
      l_uname = sy-uname.
      l_sender = cl_sapuser_bcs=>create( l_uname ).
      CALL METHOD l_send_request->set_sender
        EXPORTING
          i_sender = l_sender.
* E-Mail
      TRANSLATE p_mail TO LOWER CASE.
    l_recipient = cl_cam_address_bcs=>create_internet_address( p_mail )
      CALL METHOD l_send_request->add_recipient
        EXPORTING
          i_recipient  = l_recipient
          i_express    = 'U'
          i_copy       = ' '
          i_blind_copy = ' '
          i_no_forward = ' '.
*Trigger E-Mail immediately
      l_send_request->set_send_immediately( 'X' ).
      CALL METHOD l_send_request->send( ).
      COMMIT WORK.
    CATCH cx_document_bcs INTO l_bcs_exception.
    CATCH cx_send_req_bcs INTO l_send_exception.
    CATCH cx_address_bcs  INTO l_addr_exception.
  ENDTRY.
*&      Form  PREPARE_ATTACHMENT
FORM prepare_attachment .
  FIELD-SYMBOLS: <lfs_table>,    " Internal table structure
                 <lfs_con>.      " Field Content
  DATA: l_text TYPE char1024.     " Text content for mail attachment
  DATA: l_con(50) TYPE c.        " Field Content in character format
* Columns to be tab delimeted
  LOOP AT i_mara ASSIGNING <lfs_table>.
    DO.
      ASSIGN COMPONENT sy-index OF STRUCTURE <lfs_table>
             TO <lfs_con>.
      IF sy-subrc NE 0.
        CONCATENATE c_cr l_text INTO l_text.
        APPEND l_text TO i_attach.
        EXIT.
      ELSE.
        CLEAR: l_con.
        MOVE <lfs_con> TO l_con.
        CONDENSE l_con.
        IF sy-index = 1.
          CLEAR: l_text.
          MOVE l_con TO l_text.
        ELSE.
          CONCATENATE l_text l_con INTO l_text
             SEPARATED BY c_tab.
        ENDIF.
      ENDIF.
    ENDDO.
  ENDLOOP.
ENDFORM.                    " PREPARE_ATTACHMENT
Regards
Eswar

Similar Messages

  • * Can We Send Email Notifications Only using User Task in Oracle BPM ?? *

    Hi All,
    Can we send any email notification to initiator, only from Oracle BPM User / Human task without using any notification activity.
    Is it possible to send email notifications using BPM User task alone.
    Any Help appreciated.
    Regards
    Satya

    Hi Satya,
    To send an email to the person who initiated the work item instance in the process when the instance reaches a human task:
    1. Ensure that the id of person who initiated the instance is stored in the process predefined variable called "creator".
    2. In the Interactive activity's input data mapping, map this "creator" process predefined variable to the corresponding "creator" attribute in the human task's execData.
    3. Open the human task -> click the "Notification" tab -> click the "+" icon in the upper right -> on the new row added to the bottom of the list, leave the task status dropdown set to "Assign" and change the recipent (the middle column) to "Initiator".
    Dan

  • [SOLVED]How to send email to a local user?

    I have installed Mutt, msmtp, procmail and I can send and receive emails to/from remote hosts and I'd like to send email locally also (to the recipients on the same machine as the sender).
    When I try to send email to a local user from the root account -
    echo "Test message" | mail -s "Test subject" localuser
    then I get an error that connection to the port 25 is refused. Because the /etc/msmtprc file contains the 'localhost' as the default account's host, and on the local host I don't have a mail server listening on 25 port running.
    When I try to send email from a non-root account which has in /$HOME/.msmtprc file a real email account on a remote server, then of course there is an error that the domain for the email address 'localuser' is not recognized.
    How can sending email to local users be enabled?
    Last edited by nbd (2014-09-30 22:33:37)

    If I understand correctly, postfix it's a constantly running daemon. Seems to be an overhead for delivering only from time to time sent messages.
    ewaller wrote:
    > Out of the box, sendmail should be safe, but I think you have to enable local mail.
    Currently I have msmtp-mta installed, which is described as having sendmail functionality. If I install sendmail - will it be possible to send local email without running email daemons?

  • Can I send email invitations to local users instead of push notifications?

    I see in the documentation that "Attendees can be invited to events via email if they don’t have an iCal Server account."  Is there a way to send email invitations to local users instead of push notifications?  The server would be migrating from Exchange and everyone is accustomed to/wants email invitations for calendar events.
    I've already purchased a copy of Lion Server (10.7.4) and pretty much everything is setup.  Sadly I'm just now running into this issue.  Email invitations to non iCal server accounts work fine.
    Thanks for the help.

    Hi gracem0324,
    Go to Settings>Messages>Send & Receive, and click on your Apple ID and sign out of Messages. Then sign on again. Sometimes it needs to reset itself....
    Cheers,
    GB

  • Send EMail to Multiple external users

    Hi
    Is there a way to send EMails to multiple external users dynamically. I can see that we can send EMails to only static Email addresses for multiple external users.
    Thanks
    Vidyadhar

    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/10057e20-2ca2-2d10-1b91-a1b9a8c8e634

  • Human Workflow is not sending Email notifications to AD users

    Hi,
    I'm trying to send email notification to the assigness from workflow. If I use the weblogic users with email attributes, Its sending mails. But once I switch to AD and use the AD users it's not. I have made the AD provider to be the first in the list and also able to login to the worklist app using the same user. Problem is that it's not sending mails.
    Can anyone please help soon.
    Regards,
    Thejas

    Can you explain what are AD users and how they are created(APIs)?
    Please check that the user exists in wf_local_roles table.
    select name,notification_preference, email_address from wf_local_roles where name = <AD Username>
    In order to send email notification, the user/role should have the proper email addresses and notification preference set to MAIL* i.e MAILHTMl, MAILHTM2, MAILATTH, MAILTEXT..etc

  • Cannot send email via ActiveSync when user connect from Internet (Exchange 2010 SP3 RU5)

    Hi All. 
    This is the first time I encounter this kind of issue, whenever user connect from the internet they cannot send email from their Phone or Windows Mail App, but they can retrieve email 
    But when they connect from Internal Network they can send email. I already test ActiveSync from internet using www.testexchangeconnectivity.com and it pass all tests. 
    I also check the Firewall and all the necessary ports already opened (we even open all ports) , the default TTL on the firewall 3600 second. 
    From what I read ActiveSync use some kind of HTTP POST or in MS terminology "PING" command, but still have no idea what kind of configuration that should be made to the Firewall so it can pass this "PING" command. Because from what I
    see in Android Logcat the problem always related to this PING command 
    10-07 08:12:38.714 I/Exchange(31971): Interrupt with reason 1
    10-07 08:12:38.714 I/Exchange(31971): Ping task ending with status: -1
    10-07 08:12:38.904 D/Exchange(31971): created outputstream
    10-07 08:12:39.204 W/Exchange(31971): IOException sending mail
    10-07 08:12:39.204 E/Exchange(31971): Generic error for operation SendMail: status 200, result -100
    10-07 08:12:39.204 W/Exchange(31971): Aborting outbox sync for error -99
    10-07 08:12:39.274 I/Exchange(31971): Ping task starting for 3
    10-07 08:12:39.304 D/SyncManager(644): failed sync operation [email protected] u0 (com.android.exchange), com.android.email.provider, USER, latestRunTime 71219435, EXPEDITED, reason: 10040, SyncResult: stats [ numIoExceptions: 1]
    10-07 08:12:39.304 D/SyncManager(644): not retrying sync operation because SYNC_EXTRAS_DO_NOT_RETRY was specified [email protected]  u0 (com.android.exchange), com.android.email.provider, USER, latestRunTime 71220078, EXPEDITED, reason: 10040

    Hi ronaldosy,
    How about the work flow of Outlook or OWA on PC internally/externally?
    If only phone has this issue, I suggest ask ActiveSync Forum for help so that you can get more professional suggestions. For your convenience:
    http://social.technet.microsoft.com/Forums/exchange/en-US/home?forum=exchangesvrmobility
    Best Regards,
    Allen Wang

  • OIM 9102: Send Email Notification to other user in a task

    I created a process in OIM. In this process exist a Task: Manager Process. When this task will be completed for the user that be assigned. In the Notification Tab are able to send a email notification to a Assign User, Requester User, User or User Manager. But i need to send a email notification a other user different to them, for example: juan.perez, this user is in OIM.
    I have read the following documents:
    1.- http://docs.oracle.com/cd/E10391_01/doc.910/e10363/promgt.htm#BCECFGEJ
    2 .- How to Send an Email Notification Upon User Creation via the Admin Console [ID 780394.1]
    3.- OIM: An Example of Email Notification and Configuring it With a Resource Object Provisioning [ID 457836.1]
    4.- Sending an Approval Notification Email with a Link Directly to the Approval Request? [ID 748447.1]
    Or exist some way to do this, through java code.
    I'm using oim 9.1.0.2 BP18 running on OC4J 10.1.3.5 on AIX 6.1 64-bit clustered install with two nodes, Oracle Database 10.2.0.4 on AIX 6.1 64-bit on RAC.

    Hi
    You can use OIM email API to send an email from the java code. You can attach code on post creation user using entity adapter. Every time a user is created the email is triggered.
    Here is the sample:
    public EmailUtility(tcDataProvider dataProvider) {
              this.dataProvider = dataProvider;
              emailOper = new tcEmailNotificationUtil(dataProvider);
              System.out.println("Email API instantiated successfully...");
         public String sendEmail(String fromAddress, String toAddress, String body,
                   String subject) {
              emailOper.setBody(body);
              emailOper.setFromAddress(fromAddress);
              emailOper.setSubject(subject);
              emailOper.sendEmail(toAddress);
              System.out.println("Email sent!" + subject);
              return SUCCESS;
    Regards
    user12841694

  • Send email works for one user and not another ?!

    Hi there
    Am Apex Newbie and am developing in-house helpdesk / ticket / call logging / issue tracker type system ..
    Am putting final bells and whistles on app like sending email on raising of a problem. This is being done via Apex_Mail using new Send Email page process attached to a button.
    I.e it's not being done via UTL_SMTP explicitly in a trigger or anything.
    Here's the problem for userA the sending of email works perfectly for userB it doesn't work .. does anyone have any suggestions as to what may be wrong ?
    I thought I read somewhere that UTL_SMTP wasn't granted publicly in Apex and had to be explicitly given to individual users but I may well be mistaken.
    Any help / suggestions gratefully received .. all I can think of doing is logging onto Apex Admin and looking at the mail queue and see if that will give me any clue but Apex Admin is not really my bag per se ?!
    Thanks in advance
    Wiggywig

    Hi,
    Can you see any error from Apex logs?
    Check mail queue and mail log
    http://download.oracle.com/docs/cd/E17556_01/doc/admin.40/e15521/adm_mg_service_set.htm#sthref348
    What email address you use in From field?
    Somehow I think this relates more to SMTP server policy about sender than Apex.
    Regards,
    Jari

  • Problem in sending email to other domain users

    Hi All,
    I am using javamail for sending emails and able to send to people within my exchange server domain. The problem is i am unable to send mail to other domain users like yahoo.com, hotmail.com..the error it is throwing out is *"Invalid Address"*
    Is there any spaecial API for this to work?
    Thanks,
    Kishore

    More details, please.
    Please read the JavaMail FAQ. Post the protocol trace if you can't figure it
    out yourself.

  • Auto provisioning users and send email notification to the users

    I currently have CUCM 10.5 setup to auto register phones and I use Cisco prime provisioning 10.5 to auto provision the users.
    Self provisioning is setup and users can call the IVR number enter the self service ID, which is their DN.
    what I would like to do is send an email notifying  the end user of their setup and how to use their telephony device Example (Self-service ID: 8888, auth code: 3333) is this possible from Prime Provisioning or CUCM.

    Thanks Jamie
    Wishful thinking I guess. It would have been seamless if they added that form of email notification to end users when auto provisioning. Anyways to get around that I used MS word mail merge and used the same spread sheet I used to batch provision the users to send the Self-service ID to the email contacts.

  • System workflow sends email to only first user - CRM 2013

    I have a system workflow to create and send email.
    The "To" fields  is set  to owner;createdby;modifiedby.
    But the email goes to only the owner(the 1st one).
    If the sequence in "To" field is changed, then also the email goes to the first one.
    P kar

    Hi Abhishek,
    It is Okay to have one email.But if in "To" I am specifying 3 different fields(users), one email should go where ,
    To : USERA;USERB;USERC .............
    But it fails.The email goes only to the first user.
    Whereas if I keep multiple recipients in CC it works.
    Thanks
    P kar

  • Send email to newly registered user??

    Is there any functionality to allow for sending an email to newly registered users automatically, i.e. when the user is created by the portal administrator, the system would send the new user an email...
    Thanks,
    Jason

    Just a possible hint of solution if you can help.
    I think it is adding that capital S in front cause in that code it says cTo: '[email protected]', and i found this on this url http://support.google.com/mail/bin/answer.py?hl=en&answer=6596
    'This Gmail user does not exist...'
    This error usually occurs when there are typos in the recipient's email address. Some common errors include the following:
    Quotation marks: <'[email protected]'> or <"[email protected]">
    Dots at the end of the address: <[email protected]>
    Spaces before or after an address: < [email protected]>, <[email protected] >
    So i dunno if you could code around to somehow encapsulate my email in something else that quotation marks.
    Thanks

  • Send Email to Admin on User Profile Incremental Synchronization errors

    Hi,
    How to configure in SharePoint 2010 to send an Email to Admin, when 'User Profile Incremental Synchronization' error occurs?
    Thanks,
    Pravin

    Correct. While it would be possible to build some sort of process that resides on the SharePoint server itself, it isn't possible to do this through the SharePoint Object Model.
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • How to send email distribution to all users from report ?

    Hi all,
    I got the following report output :-
    Item_______Qty_On_hand_________Min_qty____Email
    [email protected]
    [email protected]
    [email protected]
    Once the reporis being generated, it will distirbute to all the email id list. Will this possible ? or any other better way to handle this ?
    Thanks.
    Rgds
    Lim

    hello,
    you need to use 9i or 10g for that. there you would set the "repeat on" property of you report to the group your report is based on. this will create one instance of your report for each person.
    then you need to use advanced distribution, create a distribution XML file that defines your desired email distribution with dynamic TO value.
    for further info about advanced distribution, consult the publisching reports manual.
    thanks,
    ph.

Maybe you are looking for

  • Field in BAPI_GOODSMVT_CREATE

    Hi , I am using BAPI_GOODSMVT_CREATE for creating GRN , In transcation MIGO , at line item level there is a field which does not exist in GOODSMVT_ITEM table.Please suggest me how to populate the field which does not exist in BAPI_GOODSMVT_CREATE. Re

  • Recognising portrait orientation in JPG files

    Some programs, e.g. Adobe Bridge CS3, seem to be able to recognise whether a JPG file is of a photo in portrait or landscape mode and display them as appropriate. Other programs, in particular the Screen Saver, don't seem to have this ability. I ther

  • Problem with OS update

    Whenever i try to update the OS for my phone an error code will occur and I have to download the entire update again. Only after 4-5 redownloads it gets completed. Now again APPLE has new OS 4.2 amd I am having the same problem withsome error code. C

  • Current exchange rate

    Hi Guys, i need your help please. Following situation: Transaction SE16: I open the table TCURR and set the RateType to a user defined type. I get a result table with content. But if i try to run the BAPI "BAPI_EXCHRATE_GETCURRENTRATES" with the same

  • Warehouse movement Roport

    Dear all, Few days ago a material is shown in Storage Type suppose 916 and xxxxx Storage bin.But now it does not shows any stock.That means some warehouse movement can happen.So I want to know a report from where I can find out what is the ware house