CC field in email using SO_NEW_DOCUMENT_ATT_SEND_API1

Hi,
im using FM SO_NEW_DOCUMENT_ATT_SEND_API1 to send email and it works fine. my problem is i dont know how to fill the 'CC' field of my email, im using MS Outlook by the way.
thanks for your support!

hi Jesus,
do this way ..
You need to give copy = 'X' for the parameter you are passing.
For eg..
i.e,
itab-receiver = '[email protected]'.
itab-express = 'X'.
itab-copy = ''.
itab-rec_type = 'U'. "Internet address
APPEND itab.
itab-receiver = '[email protected]'.
itab-express = 'X'.
itab-copy = 'X'.
itab-rec_type = 'U'. "Internet address
APPEND itab.
*itab-copy = 'X'.
*append itab.
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
tables
receivers = itab
Message was edited by:
        Santosh Kumar Patha

Similar Messages

  • Extra emails using SO_NEW_DOCUMENT_ATT_SEND_API1.

    Hello,
    I have a requirement to send Purchase order email to a group of people besides the vendor.
    I set the configuration to send the first email to the vendor and it is working fine.
    I would like to use SO_NEW_DOCUMENT_ATT_SEND_API1 to send the SAME EMAIL to a group of persons but I am not sure where to read the information of the already generated email to populate the FM.
    I saw some code in the forum to read the form and send it with SO_NEW_DOCUMENT_ATT_SEND_API1, but I could not find where you enter the Purchase Order number to generate the form in base of it.
    Could anybody help me to understand how to populate SO_NEW_DOCUMENT_ATT_SEND_API1 with the information of the already generated email?
    Thank you.
    Monica.

    Hi Chandra,
    Thank you for your answer.
    I did a little more research and realized that the email sent is not stored.  This takes me to the option of emailing a SAPscript form with my PO.
    I found some code in the forum to email a SAPscript  but I do see where you enter the PO number or the reference to it.
    Do you know?
    Monica.

  • Regarding EMAIL in inbox using SO_NEW_DOCUMENT_ATT_SEND_API1

    HI all,
    I am using SO_NEW_DOCUMENT_ATT_SEND_API1 module to sent emails on external email IDs.Can anyone guide me if this function module also sends email to SAP inbox correspoding to email addrees on which email is sent?
    Also guide me how to send doc to sap inbox of these email adrees using SO_NEW_DOCUMENT_ATT_SEND_API1.
    Thanks.

    Hi,
    Yes you can even send mails to the SAp inbox, by simply setting the receiver type as B in the RECEIVERS tables parameter.
    Regards
    Pavan

  • Sending Carbon Copy using SO_NEW_DOCUMENT_ATT_SEND_API1

    Hello,
    I am using SO_NEW_DOCUMENT_ATT_SEND_API1' to send out email letting people know a direct deposit has been posted to their bank.  My problem is that the Acct department wants a carbon copy sent to their email address for each email that is sent.  Looking at this function, there is a line called
    RECEIVERS = IT_RECLIST.  When I take this thru debug, I see IT_RECLIST  defined as TYPE TABLE OF SOMLRECI1.  When I see the fields in IT_RECLIST, there is a field called copy, I assume I set this flag = 'X' to let the function know I want a carbon copy, correct?  Also, I am confused as to where the carbon copy email address would go, because all I see is a field called RECEIVER that is holding the recipients email.  Can you guys set me straight here?

    u can't send a carbon copy...instead while sending the email, the same can be sent to 2 or more people at a time. Add the email address to the existing list and it will trigger same email to the department.

  • Loss of sending email using WIFI

    As of this morning 8-20-08, after updating to 2.02, I no longer am able to send emails using my own wireless network. Previously this was no problem. Neither Fido or Apple have any idea of what I am talking about. Fido washed their hands as they do not support WIFI. How convenient, they sell the phone and charge for the service but do not support it. Videotron, my ISP, thinks the issue is my wireless router but I can send via gmail so that's out. I resovled the problem by configuring my accounts to use my gmail smtp server as a second option and now the spinning wheel is short lived and messages are sent.
    I'm sorry to say that I had fallen for all the hype about Apple but truth is they are but a Microsoft wannabe.
    Disinchanted

    So here's the wierd thing.
    I was having the same problems. Set up SMTP for Videotron when at home using relais.videotron.ca SMTP with no authenticationon port 25 & all was good in the world. However when I went out, bang. Nothing. Couldn't send a mail for love nor money.
    Thought aboutit & changed settings to use relais.videotron.ca SMTP, but this time using authentication of vltl** / password credentials with no SSL (Videotron doesn't use SSL) and again everything was fine. Of course, when I got home again, bang. Everything fell over & no more mail sending foe me!
    So I figure, when I'm at home I'm on my trusted network at port 25, I don't need authentication and all is good, but when I'm out i'm seen as potential SPAM by port 25 on videotron & get blocked.
    Tried using port 587 instead when for both home & mobile but had no luck either.
    Then a strange thing happened. I'd resolved to having to set up 2 SMTP servers on my iPhone & switching between the two based on where I was. Pain in the a**, but there's always a trade off for early adopter technology So I set up my primary SMTP to use port 25 with no authentication, and a secondary server to use the same relais.videotron.ca outgoing server, but this time WITH authentication using vltl** \ password credentials.
    After a walk to the shop when I'd been on my secondary SMTP server (successfully sending & recieving) I came home & inadvertantly forgot to swith back to my primary SMTP. Recieved a mail & then responded with no problem!
    Net result, I now have a permanently switced off primary server & a permanently switched on secondary server which uses relais.videotron.ca details with vltl** \ password authentication credentials active (like I did on my old silver iPhone) & all is good in the world, both at home & out mobile, both for sending & recieving!
    Will field test some more tomorrow but it may be a 2.0.2 bug where ther primary server details fcuk up whereas the secondary server details are stable.
    So long as it works, who cares!
    Jof

  • TS3899 issues sending email using my gmail account on my new iphone4s.

    so i was having issues sending email using my gmail account on my new iphone4s.  i called my provider, att - to fix the issue, mine anyway, under settings - general - reset - reset network connections.  fixes the send issue.  releases all of the other junk that was left on your old phone. 

    Hi Jari,
    Thanks to reply me.
    There is an workspace details where user solve that problem but now i have troed to access that workspace but its not working .i have cofusion how can i do this where i put
    apex_mail.send(
    p_to => v_recipient_list
    , p_from => v_from_list
    , p_subj => 'Hello world'
    , p_body => v_body
    , p_replyto => null);
    this package
    and how to and where set SMTP of Gmail and i don't know about gmail SMTP Server Specification
    i ahve jus create a form with
    P1_TO Text Field
    P1_SUBJECT Text Field
    P1_FILE_BRE File Browse...
    P1_COMMENT Textarea
    Please guid me...how can i do that step by step
    Thanks

  • Reg : Issue for Sending of external email using SO_OBJECT_SEND

    There is one issue while sending external email using SO_OBJECT_SEND functional module.
    1. The body of the mail is also included as attachment.
    I want to avoid the same.
    Please anyone can give the solution.

    hi check this example ,
    Sending mail with attachment report in Background
    Content Author: Fernando Faian
    I have read the hint about "Sending mail with attachment report".
    It's great, but how can I make this function work in background??
    I had that needed last year too. See attachment a function group with two functions. The second one has that functionality to send email or fax (SAP office) with attachment objects in background job using SO_ATTACHMENT_INSERT function. 
    Pay attention because it’s working with output list from spool converted to pdf. 
    =================================================================================
    z_send_email_fax_global
    FUNCTION-POOL z_gfaian_mail_fax.            "MESSAGE-ID ..
    WORK TABLE AREAS
    TABLES: tsp01.
    INTERNAL TABLES
    DATA: lt_rec_tab LIKE STANDARD TABLE OF soos1 WITH HEADER LINE,
          lt_note_text   LIKE STANDARD TABLE OF soli  WITH HEADER LINE,
          lt_attachments LIKE STANDARD TABLE OF sood5 WITH HEADER LINE.
    DATA: lt_objcont LIKE STANDARD TABLE OF soli WITH HEADER LINE,
          lt_objhead LIKE STANDARD TABLE OF soli WITH HEADER LINE.
    DATA: pdf_format LIKE STANDARD TABLE OF tline WITH HEADER LINE.
    TYPES: BEGIN OF y_files,
           file(60) TYPE c,
           END OF y_files.
    DATA: lt_files TYPE STANDARD TABLE OF y_files WITH HEADER LINE.
    DATA: l_objcont     LIKE soli OCCURS 0 WITH HEADER LINE.
    DATA: l_objhead     LIKE soli OCCURS 0 WITH HEADER LINE.
    STRUCTURES
    DATA: folder_id      LIKE soodk,
          object_id      LIKE soodk,
          link_folder_id LIKE soodk,
          g_document     LIKE sood4,
         g_header_data  LIKE sood2,
          g_folmem_data  LIKE sofm2,
          g_header_data  LIKE sood2,
          g_receive_data LIKE soos6,
          g_ref_document LIKE sood4,
          g_new_parent   LIKE soodk,
          l_folder_id    LIKE sofdk,
          v_email(50).
    DATA: hd_dat  like sood1.
    VARIABLES
    DATA: client  LIKE tst01-dclient,
          name    LIKE tst01-dname,
          objtype LIKE rststype-type,
          type    LIKE rststype-type.
    DATA: numbytes TYPE i,
          arc_idx LIKE toa_dara,
          pdfspoolid LIKE tsp01-rqident,
          jobname LIKE tbtcjob-jobname,
          jobcount LIKE tbtcjob-jobcount,
          is_otf.
    DATA: outbox_flag LIKE sonv-flag VALUE 'X',
          store_flag  LIKE sonv-flag,
          delete_flag LIKE sonv-flag,
          owner       LIKE soud-usrnam,
          on          LIKE sonv-flag VALUE 'X',
          sent_to_all LIKE sonv-flag,
          g_authority LIKE sofa-usracc,
          w_objdes    LIKE sood4-objdes.
    DATA: c_file LIKE rlgrap-filename,
          n_spool(6) TYPE n.
    DATA: cancel.
    DATA: desired_type  LIKE sood-objtp,
          real_type LIKE sood-objtp,
          attach_type LIKE sood-objtp,
          otf LIKE sood-objtp VALUE 'OTF', " SAPscript Ausgabeformat
          ali LIKE sood-objtp VALUE 'ALI'. " ABAP lists
    CONSTANTS
    CONSTANTS: ou_fol LIKE sofh-folrg              VALUE 'O',
               c_objtp    LIKE g_document-objtp    VALUE 'RAW',
               c_file_ext LIKE g_document-file_ext VALUE 'TXT'.
    =================================================================================
    z_send_email_fax2
    FUNCTION z_faian_mail_fax2.
    ""Interface local:
    *"  IMPORTING
    *"     REFERENCE(SRC_SPOOLID) LIKE  TSP01-RQIDENT
    *"     REFERENCE(FAX_MAIL_NUMBER) TYPE  SO_NAME
    *"     REFERENCE(HEADER_MAIL) TYPE  SO_OBJ_DES
    *"     REFERENCE(OBJECT_TYPE) TYPE  SO_ESCAPE
    *"  TABLES
    *"      LT_BODY_EMAIL STRUCTURE  SOLI
    *"  EXCEPTIONS
    *"      ERR_NO_ABAP_SPOOLJOB
    Fist part: Verify if the spool really exists
      SELECT SINGLE * FROM tsp01 WHERE rqident = src_spoolid.
      IF sy-subrc NE 0.
        RAISE err_no_abap_spooljob. "doesn't exist
      ELSE.
        client = tsp01-rqclient.
        name   = tsp01-rqo1name.
        CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
             EXPORTING
                  authority     = 'SP01'
                  client        = client
                  name          = name
                  part          = 1
             IMPORTING
                  type          = type
                  objtype       = objtype
             EXCEPTIONS
                  fb_error      = 1
                  fb_rsts_other = 2
                  no_object     = 3
                  no_permission = 4
                  OTHERS        = 5.
        IF objtype(3) = 'OTF'.
          desired_type = otf.
        ELSE.
          desired_type = ali.
        ENDIF.
        CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
             EXPORTING
                  rqident              = src_spoolid
                  desired_type         = desired_type
             IMPORTING
                  real_type            = real_type
             TABLES
                  buffer               = l_objcont
             EXCEPTIONS
                  no_such_job          = 14
                  type_no_match        = 94
                  job_contains_no_data = 54
                  no_permission        = 21
                  can_not_access       = 21
                  read_error           = 54.
        IF sy-subrc EQ 0.
          attach_type = real_type.
        ENDIF.
        CALL FUNCTION 'SO_FOLDER_ROOT_ID_GET'
             EXPORTING
                  owner     = sy-uname
                  region    = ou_fol
             IMPORTING
                  folder_id = l_folder_id
             EXCEPTIONS
                  OTHERS    = 5.
    fill out informations about the header of the email
        CLEAR: g_document.
        g_document-foltp     = l_folder_id-foltp.
        g_document-folyr     = l_folder_id-folyr.
        g_document-folno     = l_folder_id-folno.
        g_document-objtp     = c_objtp.
        g_document-objdes    = header_mail.
        g_document-file_ext  = c_file_ext.
        g_header_data-objdes    = header_mail.
        CALL FUNCTION 'SO_DOCUMENT_REPOSITORY_MANAGER'
             EXPORTING
                  method      = 'SAVE'
                  office_user = sy-uname
             IMPORTING
                  authority   = g_authority
             TABLES
                  objcont     = lt_body_email
                  attachments = lt_attachments
             CHANGING
                  document    = g_document
                  header_data = g_header_data
             EXCEPTIONS
                  OTHERS      = 1.
        folder_id-objtp = l_folder_id-foltp.
        folder_id-objyr = l_folder_id-folyr.
        folder_id-objno = l_folder_id-folno.
        object_id-objtp = c_objtp.
        object_id-objyr = g_document-objyr.
        object_id-objno = g_document-objno.
        link_folder_id-objtp = l_folder_id-foltp.
        link_folder_id-objyr = l_folder_id-folyr.
        link_folder_id-objno = l_folder_id-folno.
        REFRESH lt_rec_tab.
       CLEAR lt_rec_tab.
       lt_rec_tab-sel        = 'X'.
       lt_rec_tab-recesc     = object_type.   "This field for FAX/MAIL
       lt_rec_tab-recnam     = 'U-'.
       lt_rec_tab-deliver    = 'X'.
       lt_rec_tab-not_deli   = 'X'.
       lt_rec_tab-read       = 'X'.
       lt_rec_tab-mailstatus = 'E'.
       lt_rec_tab-adr_name   = fax_mail_number.
       lt_rec_tab-sortfield  = fax_mail_number.
       lt_rec_tab-recextnam  = fax_mail_number.
       lt_rec_tab-sortclass  = '5'.
       APPEND lt_rec_tab.
          lt_rec_tab-recextnam = fax_mail_number.
          lt_rec_tab-recesc = object_type.
          lt_rec_tab-sndart = 'INT'.
          lt_rec_tab-sndpri = 1.
          APPEND lt_rec_tab.
        lt_files-file = c_file.
        APPEND lt_files.
    begin of insertion by faianf01
        hd_dat-objdes = header_mail.
        CALL FUNCTION 'SO_ATTACHMENT_INSERT'
             EXPORTING
                  object_id                  = object_id
                  attach_type                = attach_type
                  object_hd_change           = hd_dat
                  owner                      = sy-uname
             TABLES
                  objcont                    = l_objcont
                  objhead                    = l_objhead
             EXCEPTIONS
                  active_user_not_exist      = 35
                  communication_failure      = 71
                  object_type_not_exist      = 17
                  operation_no_authorization = 21
                  owner_not_exist            = 22
                  parameter_error            = 23
                  substitute_not_active      = 31
                  substitute_not_defined     = 32
                  system_failure             = 72
                  x_error                    = 1000.
        IF sy-subrc > 0.
        ENDIF.
    end of insertion by faianf01
    send email from SAPOFFICE
        CALL FUNCTION 'SO_OBJECT_SEND'
             EXPORTING
                  folder_id                  = folder_id
                  object_id                  = object_id
                  outbox_flag                = outbox_flag
                  link_folder_id             = link_folder_id
                  owner                      = sy-uname
                 check_send_authority       = 'X'
             TABLES
                  receivers                  = lt_rec_tab
                 note_text                  = lt_note_text
             EXCEPTIONS
                  active_user_not_exist      = 35
                  communication_failure      = 71
                  component_not_available    = 1
                  folder_no_authorization    = 5
                  folder_not_exist           = 6
                  forwarder_not_exist        = 8
                  object_no_authorization    = 13
                  object_not_exist           = 14
                  object_not_sent            = 15
                  operation_no_authorization = 21
                  owner_not_exist            = 22
                  parameter_error            = 23
                  substitute_not_active      = 31
                  substitute_not_defined     = 32
                  system_failure             = 72
                  too_much_receivers         = 73
                  user_not_exist             = 35.
      ENDIF.
    ENDFUNCTION.
    =================================================================================
    z_send_email_fax
    FUNCTION ZCBFS_SEND_MAIL.
    ""Interface local:
    *"  IMPORTING
    *"     REFERENCE(SRC_SPOOLID) LIKE  TSP01-RQIDENT
    *"     REFERENCE(HEADER_MAIL) TYPE  SO_OBJ_DES
    *"  TABLES
    *"      LIST_FAX_MAIL_NUMBER STRUCTURE  SOLI
    *"  EXCEPTIONS
    *"      ERR_NO_ABAP_SPOOLJOB
      DATA: vg_achou(1) TYPE n.
    Fist part: Verify if the spool really exists
      vg_achou = 1.
      DO 60 TIMES.
        SELECT SINGLE * FROM tsp01 WHERE rqident = src_spoolid.
        IF sy-subrc IS INITIAL.
          CLEAR vg_achou.
          EXIT.
        ELSE.
          WAIT UP TO 1 SECONDS.
        ENDIF.
      ENDDO.
      IF vg_achou = 1.
        RAISE err_no_abap_spooljob. "doesn't exist
      ENDIF.
      client = tsp01-rqclient.
      name   = tsp01-rqo1name.
      CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
           EXPORTING
                authority     = 'SP01'
                client        = client
                name          = name
                part          = 1
           IMPORTING
                type          = type
                objtype       = objtype
           EXCEPTIONS
                fb_error      = 1
                fb_rsts_other = 2
                no_object     = 3
                no_permission = 4
                OTHERS        = 5.
      IF objtype(3) = 'OTF'.
        desired_type = otf.
      ELSE.
        desired_type = ali.
      ENDIF.
      CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
           EXPORTING
                rqident              = src_spoolid
                desired_type         = desired_type
           IMPORTING
                real_type            = real_type
           TABLES
                buffer               = l_objcont
           EXCEPTIONS
                no_such_job          = 14
                type_no_match        = 94
                job_contains_no_data = 54
                no_permission        = 21
                can_not_access       = 21
                read_error           = 54.
      IF sy-subrc EQ 0.
        attach_type = real_type.
      ENDIF.
      CALL FUNCTION 'SO_FOLDER_ROOT_ID_GET'
           EXPORTING
                owner     = sy-uname
                region    = ou_fol
           IMPORTING
                folder_id = l_folder_id
           EXCEPTIONS
                OTHERS    = 5.
    fill out informations about the header of the email
      CLEAR: g_document.
      g_document-foltp     = l_folder_id-foltp.
      g_document-folyr     = l_folder_id-folyr.
      g_document-folno     = l_folder_id-folno.
      g_document-objtp     = c_objtp.
      g_document-objdes    = header_mail.
      g_document-file_ext  = c_file_ext.
      g_header_data-objdes    = header_mail.
      CALL FUNCTION 'SO_DOCUMENT_REPOSITORY_MANAGER'
           EXPORTING
                method      = 'SAVE'
                office_user = sy-uname
           IMPORTING
                authority   = g_authority
           TABLES
                attachments = lt_attachments
           CHANGING
                document    = g_document
                header_data = g_header_data
           EXCEPTIONS
                OTHERS      = 1.
      folder_id-objtp = l_folder_id-foltp.
      folder_id-objyr = l_folder_id-folyr.
      folder_id-objno = l_folder_id-folno.
      object_id-objtp = c_objtp.
      object_id-objyr = g_document-objyr.
      object_id-objno = g_document-objno.
      link_folder_id-objtp = l_folder_id-foltp.
      link_folder_id-objyr = l_folder_id-folyr.
      link_folder_id-objno = l_folder_id-folno.
      REFRESH lt_rec_tab.
      LOOP AT LIST_FAX_MAIL_NUMBER.
        lt_rec_tab-recextnam = LIST_FAX_MAIL_NUMBER-LINE.
        lt_rec_tab-recesc = 'U'.
        lt_rec_tab-sndart = 'INT'.
        lt_rec_tab-sndpri = 1.
        APPEND lt_rec_tab.
      ENDLOOP.
      lt_files-file = c_file.
      APPEND lt_files.
      hd_dat-objdes = header_mail.
      CALL FUNCTION 'SO_ATTACHMENT_INSERT'
           EXPORTING
                object_id                  = object_id
                attach_type                = attach_type
                object_hd_change           = hd_dat
                owner                      = sy-uname
           TABLES
                objcont                    = l_objcont
                objhead                    = l_objhead
           EXCEPTIONS
                active_user_not_exist      = 35
                communication_failure      = 71
                object_type_not_exist      = 17
                operation_no_authorization = 21
                owner_not_exist            = 22
                parameter_error            = 23
                substitute_not_active      = 31
                substitute_not_defined     = 32
                system_failure             = 72
                x_error                    = 1000.
      IF sy-subrc > 0.
      ENDIF.
    send email from SAPOFFICE
      CALL FUNCTION 'SO_OBJECT_SEND'
           EXPORTING
                folder_id                  = folder_id
                object_id                  = object_id
                outbox_flag                = outbox_flag
                link_folder_id             = link_folder_id
                owner                      = sy-uname
           TABLES
                receivers                  = lt_rec_tab
                note_text                  = lt_note_text
           EXCEPTIONS
                active_user_not_exist      = 35
                communication_failure      = 71
                component_not_available    = 1
                folder_no_authorization    = 5
                folder_not_exist           = 6
                forwarder_not_exist        = 8
                object_no_authorization    = 13
                object_not_exist           = 14
                object_not_sent            = 15
                operation_no_authorization = 21
                owner_not_exist            = 22
                parameter_error            = 23
                substitute_not_active      = 31
                substitute_not_defined     = 32
                system_failure             = 72
                too_much_receivers         = 73
                user_not_exist             = 35.
    ENDFUNCTION.
    =================================================================================
    regards,
    venkat.

  • Sending email using IMAP through SMTP Port 587

    Hi,
    I have been sending Mail Merged email to people in organizations that I am active in, using IMAP embedded in StarOffice 5.2 (on Windows 98 Second Edition). This worked fine until a few weeks ago when I received an error message stating that AOL, as part of their anti-spam efforts, was no longer accepting third-party emails on default port 25. All third-party email must now use port 587. I looked in the IMAP dialog and in the Tools -> Options dialog, but did not see any place to change the SMTP port. The AOL error message information page had instructions for changing the port in other applications (Outlook, Eudora, etc.), but not for StarOffice. So, I have some questions:
    1.Is it possible to change the port in StarOffice 5.2?
    2.If not, how does StarOffice 8 send Mail Merged email? Does it use IMAP, and if so, can the port be changed?
    3.Also, I like the integrated configuration in StarOffice 5.2, where database fields can be directly accessed in the Insert -> Fields -> Other dialog. In looking at the Mail Merge section in "SO8_What's New.pdf", it appears that Mail Merge in StarOffice 8 is restricted to predefined fields. Could I still access fields from my existing databases?
    These is a lot of questions, but right now I am blocked from sending Mail Merged emails which is imparing communications with volunteers who are running educational programs. I appreciate any and all help that anyone can provide.

    Please try this out!!!!!!!!!
    You can send emails using Outlook also. You can send email over Microsoft Exchange with this object (or another email server, using IMAP/POP).
    Sub SendMailOutlook(aTo, Subject, TextBody, aFrom)
    'Create an Outlook object
    Dim Outlook 'As New Outlook.Application
    Set Outlook = CreateObject("Outlook.Application")
    'Create e new message
    Dim Message 'As Outlook.MailItem
    Set Message = Outlook.CreateItem(olMailItem)
    With Message
    'You can display the message To debug And see state
    '.Display
    .Subject = Subject
    .Body = TextBody
    'Set destination email address
    .Recipients.Add (aTo)
    'Set sender address If specified.
    Const olOriginator = 0
    If Len(aFrom) > 0 Then .Recipients.Add(aFrom).Type = olOriginator
    'Send the message
    .Send
    End With
    End Sub

  • Sending an Email using Notification Task

    Hi All,
    How can we send an email using notification task?? Can someone provide me the steps to achieve this.
    Is it possible to send email to multiple users at a time??
    Thanks.

    Good you're on 11.1.1.6. The link in Vlad and copied into my response should help then.
    You'd fill in the fields for the to, from, subject, cc, message body using variable(s) you populated upstream in the process.
    You're not there yet, but most people struggle (me included) getting the email server set up to send the emails once the process is deployed and running. Here are the steps:
    In Enterprise Manager:
    1. Expand "SOA" -> right mouse click "soa-infra" -> click "SOA Administration" -> click "Workflow Notification Properties".
    2. Select "Email" from the Notification Mode dropdown and enter email adresses for the three fields.
    3. Expand "User Message Service" -> right mouse click "usermessagingdriver-email" -> click "Email Driver Properties".
    4. Scroll down until you see the email server properties -> enter the appropriate values in these fields: OutgoingMailServer, OutgoingUsername, OutgoingPassword.
    Verify that the user(s) you want to send emails to have an email address set. If you are using the default WebLogic security, in the WebLogic Console:
    5. Click "Security Realms" -> click "myrealm".
    6. Click the "Users and Groups" tab -> click the "User" tab.
    7. Click the user id of the user you will be sending email to.
    8. Click the "Attributes" tab -> make sure the "mail" attribute has a valid email address. If it does not have an email address, once you have entered it, be sure to hit the Enter* key to have it stick in the field.

  • Sending mails to UWL using SO_NEW_DOCUMENT_ATT_SEND_API1 function module

    Hi all,
    is it possible to view mails send using SO_NEW_DOCUMENT_ATT_SEND_API1 function module to UWL?
    I am receving emails in my SAP Inbox.
    Please guide.
    thanks.

    Hi,
    You can only get the SAP mails into UWL notification tab with the Sonic connector (well of course with some custom development everything is possible).
    One trick to get the workflow for sending "mails" to UWL is to NOT use email sending step, but instead use a decision step in the workflow and send this work item to the user. The decision step can include the same message as the email, and have onl one option "Confirm" (or whatever). These you can easily display in UWL since they are normal work items.
    Regards,
    Karri

  • E-mail functionality using so_new_document_att_send_api1

    Hi
    We Implemented E-mail functionality in our tool useing "so_new_document_att_send_api1" standard FM but here im unable to attach excel document .How to attach a excel document in this standard FM plz help.
    Asif

    hi try this code
    *& Report  ZTEST_2                                                     *
    *& Report  ZTEST_2                                                     *
    REPORT  ztest_2                                 .
    TYPES : BEGIN OF t_email_update_iw32,
             aufnr LIKE viaufks-aufnr,
             vornr LIKE afvc-vornr,
             text(220),
            END OF t_email_update_iw32.
    DATA : gt_email_update_iw32 TYPE STANDARD TABLE OF t_email_update_iw32,
           gw_email_update_iw32 TYPE t_email_update_iw32.
    TYPES : BEGIN OF t_email_date_error,
             aufnr LIKE viaufks-aufnr,
             prueflos LIKE qamr-prueflos,
             merknr  LIKE qamr-merknr,
             text(220),
            END OF t_email_date_error.
    DATA : gt_email_date_error TYPE STANDARD TABLE OF t_email_date_error,
           gw_email_date_error TYPE t_email_date_error.
    TYPES : BEGIN OF t_email_conf_doc_error,
             aufnr LIKE viaufks-aufnr,
             vornr LIKE afvc-vornr,
             text(220),
            END OF t_email_conf_doc_error.
    DATA : gt_email_conf_doc_error TYPE STANDARD TABLE OF
    t_email_conf_doc_error,
           gw_email_conf_doc_error TYPE t_email_conf_doc_error.
    SELECTION-SCREEN : BEGIN OF BLOCK b4 WITH FRAME TITLE text-004.
    PARAMETERS : cb_email AS CHECKBOX DEFAULT 'X'.
    *SELECTION-SCREEN BEGIN OF LINE.
    *SELECTION-SCREEN COMMENT (16) text-007 FOR FIELD p_email1.
    PARAMETERS : p_email LIKE somlreci1-receiver,
                 p_email1 LIKE adr6-smtp_addr.
    PARAMETERS : p_table1 AS CHECKBOX,
                 p_table2 AS CHECKBOX,
                 p_table3 AS CHECKBOX.
    SELECTION-SCREEN : END OF BLOCK b4.
    CLEAR gw_email_update_iw32.
    REFRESH gt_email_update_iw32.
    gw_email_update_iw32-aufnr = '1234567'.
    gw_email_update_iw32-vornr = '0010'.
    gw_email_update_iw32-text = 'This is table1'.
    APPEND  gw_email_update_iw32 TO gt_email_update_iw32.
    CLEAR gw_email_update_iw32.
    gw_email_update_iw32-aufnr = '4564578'.
    gw_email_update_iw32-vornr = '0020'.
    gw_email_update_iw32-text = 'This is table1'.
    APPEND  gw_email_update_iw32 TO gt_email_update_iw32.
    gw_email_date_error-aufnr = '222615'.
    gw_email_date_error-prueflos = '1111'.
    gw_email_date_error-merknr = '2222'.
    gw_email_date_error-text = 'This is table2'.
    APPEND gw_email_date_error TO gt_email_date_error.
    gw_email_date_error-aufnr = '222615'.
    gw_email_date_error-prueflos = '3333'.
    gw_email_date_error-merknr = '4444'.
    gw_email_date_error-text = 'This is table2'.
    APPEND gw_email_date_error TO gt_email_date_error.
    gw_email_conf_doc_error-aufnr = '9900107987'.
    gw_email_conf_doc_error-vornr = '999999'.
    gw_email_conf_doc_error-text  = 'This is table3'.
    APPEND gw_email_conf_doc_error TO gt_email_conf_doc_error.
    gw_email_conf_doc_error-aufnr = '9900107987'.
    gw_email_conf_doc_error-vornr = '999999'.
    gw_email_conf_doc_error-text  = 'This is table3'.
    APPEND gw_email_conf_doc_error TO gt_email_conf_doc_error.
    DATA : lw_space VALUE ''.
    SET PARAMETER ID 'ZPDF' FIELD lw_space.
    DATA : pripar LIKE pri_params.
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
      EXPORTING
        in_parameters          = pripar
        line_size              = 255
        layout                 = 'X_65_132'
        no_dialog              = 'X'
      IMPORTING
        out_parameters         = pripar
      EXCEPTIONS
        archive_info_not_found = 1
        invalid_print_params   = 2
        invalid_archive_params = 3
        OTHERS                 = 4.
    NEW-PAGE PRINT ON PARAMETERS pripar NO DIALOG .
    RESERVE 5 LINES.
    DATA : text1(10) TYPE c  VALUE 'AUFNR',
           text2(10) TYPE c VALUE 'VORNR',
           text3(50) TYPE c VALUE 'TEXT'.
    IF p_table1 = 'X'.
      WRITE  AT 10   text1. WRITE AT 30  text2 . WRITE AT 30 text3.
      LOOP AT  gt_email_update_iw32 INTO  gw_email_update_iw32.
        WRITE : /  gw_email_update_iw32-aufnr , gw_email_update_iw32-vornr ,
    gw_email_update_iw32-text.
      ENDLOOP.
    ENDIF.
    WRITE : / sy-uline .
    IF p_table2 = 'X'.
      WRITE : / 'AUFNR' , 'PRUEFLOS' ,  'MERKNR', 'TEXT' .
      LOOP AT gt_email_date_error INTO gw_email_date_error.
        WRITE : / gw_email_date_error-aufnr, gw_email_date_error-prueflos,
    gw_email_date_error-merknr,gw_email_date_error-text.
      ENDLOOP.
    ENDIF.
    WRITE : / sy-uline .
    IF p_table3 = 'X'.
      WRITE : / 'AUFNR' , 'VORNR' , 'TEXT' .
      LOOP AT gt_email_conf_doc_error INTO gw_email_conf_doc_error.
        WRITE : / gw_email_conf_doc_error-aufnr,
    gw_email_conf_doc_error-vornr, gw_email_conf_doc_error-text.
      ENDLOOP.
    ENDIF.
    NEW-PAGE PRINT OFF.
    DATA : mtab_pdf LIKE tline OCCURS 0 WITH HEADER LINE.
    DATA : rqident LIKE tsp01-rqident ,
           rqcretime LIKE tsp01-rqcretime .
    SELECT  rqident  rqcretime FROM tsp01
           INTO (rqident,rqcretime)
           WHERE rqowner = sy-uname
           ORDER BY rqcretime DESCENDING.
      EXIT.
    ENDSELECT.
    DATA: spool_id LIKE tsp01-rqident.
    MOVE  rqident TO spool_id.
    DATA : p_file LIKE rlgrap-filename VALUE 'C:\file.pdf' ,
           numbytes TYPE i,
           cancel.
    CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
      EXPORTING
        src_spoolid = spool_id
          NO_DIALOG =
          DST_DEVICE =
          PDF_DESTINATION =
    IMPORTING
        pdf_bytecount = numbytes
          PDF_SPOOLID =
          LIST_PAGECOUNT =
          BTC_JOBNAME =
          BTC_JOBCOUNT =
      TABLES
        pdf = mtab_pdf
    EXCEPTIONS
       err_no_abap_spooljob = 1
       err_no_spooljob = 2
       err_no_permission = 3
       err_conv_not_possible = 4
       err_bad_destdevice = 5
       user_cancelled = 6
       err_spoolerror = 7
       err_temseerror = 8
       err_btcjob_open_failed = 9
       err_btcjob_submit_failed = 10
       err_btcjob_close_failed = 11
       OTHERS = 12
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    end
    DATA :  w_buffer TYPE string. "To convert from 132 to 255
    DATA : i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE.
    LOOP AT mtab_pdf.
    Replacing space by ~
      TRANSLATE mtab_pdf USING ' ~'.
      CONCATENATE w_buffer mtab_pdf INTO w_buffer.
    ENDLOOP.
    Replacing ~ by space
    TRANSLATE w_buffer USING '~ ' .
    DO.
      i_record = w_buffer.
    Appending 255 characters as a record
      APPEND i_record.
      SHIFT w_buffer LEFT BY 255 PLACES.
      IF w_buffer IS INITIAL.
        EXIT.
      ENDIF.
    ENDDO.
    *start try
    DATA: objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
    DATA: objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
    DATA: objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE.
    DATA: objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE.
    DATA: reclist LIKE somlreci1 OCCURS 5 WITH HEADER LINE.
    DATA: doc_chng LIKE sodocchgi1.
    DATA : tab_lines TYPE c.
    doc_chng-obj_name = 'TEST'.
    doc_chng-obj_descr = 'Mail came successfully'.
    objtxt = 'Regards'.
    APPEND objtxt.
    objtxt = 'Nitin'.
    APPEND objtxt.
    objtxt = 'hahaha'.
    APPEND objtxt.
    DESCRIBE TABLE objtxt LINES tab_lines.
    READ TABLE objtxt INDEX tab_lines.
    doc_chng-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
    * ERSTELLEN DES EINTRAGS ZUM KOMPRIMIERTEN DOKUMENT
    CLEAR objpack-transf_bin.
    objpack-head_start = 1.
    objpack-head_num = 0.
    objpack-body_start = 1.
    objpack-body_num = tab_lines.
    objpack-doc_type = 'RAW'.
    APPEND objpack.
    * ERSTELLEN DER ANLAGE FUR DAS DOKUMENT
    **OBJBIN = '\O/ '. APPEND OBJBIN.
    **OBJBIN = ' '. APPEND OBJBIN.
    **OBJBIN = ' / \ '. APPEND OBJBIN.
    LOOP AT i_record.
      objbin[] =  i_record[].
    ENDLOOP.
    DESCRIBE TABLE objbin LINES tab_lines.
    *objhead = 'picasso.txt'. APPEND objhead.
    * Erstellen des Eintrags zur komprimierten Anlage
    objpack-transf_bin = 'X'.
    objpack-head_start = 1.
    objpack-head_num = 1.
    objpack-body_start = 1.
    objpack-body_num = tab_lines.
    objpack-doc_type = 'PDF'.
    objpack-obj_name = 'PDF File received '.
    objpack-obj_descr = 'PDF File received '.
    *objpack-doc_size = ( tab_lines ) * 255 .
    APPEND objpack.
    * Fullen der Empfangerliste
    refresh reclist.
    reclist-rec_type = 'U'.
    reclist-receiver = p_email1.
    APPEND reclist.
    reclist-rec_type = 'B'.
    reclist-receiver = sy-uname.
    APPEND reclist.
    reclist-rec_type = 'U'.
    reclist-receiver = p_email.
    APPEND reclist.
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
      EXPORTING
        document_data              = doc_chng
        put_in_outbox              = 'X'
      TABLES
        packing_list               = objpack
       object_header              = objhead
        contents_bin               = objbin
        contents_txt               = objtxt
        receivers                  = reclist
      EXCEPTIONS
        too_many_receivers         = 1
        document_not_sent          = 2
        operation_no_authorization = 4
        OTHERS                     = 99.

  • Mails in UWL using SO_NEW_DOCUMENT_ATT_SEND_API1

    Hi all,
    is it possible to view mails send using SO_NEW_DOCUMENT_ATT_SEND_API1 function module to UWL?
    I am receving emails in my SAP Inbox.
    Please guide.
    thanks.

    I believe you can use SONiC. You might want to do some research on that.

  • How to format and send html email using utl_smtp

    Hi,
    I need to send email in the html format from within the database using utl_smtp. I am really not interested in creating os level file using "set markup html on spool on" and sending that as an html attachment. Can someone please give a code?
    1. Output of a select needs to be emailed (for example : select empid, name from emp, salary)
    2. Certian cells for example salary < 4800 needs to be higlighted in Red color
    3. I need to send email which is having more than 32767 characters (I can not use varchar2 field)
    I have reffered to following url on asktom:
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1739411218448
    However it does not help.
    If someone has a sample code with any select from a table, it would be a great help.
    Regards
    Sudhanshu Bhandari

    There have been many very good threads on sending email using the UTL_SMTP on the forum including threads that deal with HTML formated mail.
    The basic process is to the same as with sending regular (non HTML) mail, but you add some additional headers to the mail message as well as additional formatting to the message body (e.g. HTML tags as needed).
    Specifically you need to add the two following headers:
    MIME-Version: 1.0
    Content-type: text/html

  • Send email through SO_NEW_DOCUMENT_ATT_SEND_API1 with PDF attachement of smartforms.

    Hi,
    I am converting a smartform to PDF and then sending it as an attachment to email using FM SO_NEW_DOCUMENT_ATT_SEND_API1.
    But I am getting this error. 'Error calling FM <SBCOMS_SEND_REQUEST_CREATE> in <SO_DOCUMENT_SEND_API1> with SY-SUBRC <1>'
    I am passing below entries to packaging list table.
    Packing list for Email Text
            ls_packing_list-head_start = 1.
            ls_packing_list-head_num   = 1.
            ls_packing_list-body_start = 1.
            ls_packing_list-doc_type   = 'RAW'.
    Packing list for PDF
            ls_packing_list-transf_bin = 'X'
            ls_packing_list-head_start = 1.
            ls_packing_list-head_num   = 1.
            ls_packing_list-body_start = 1.
            ls_packing_list-doc_type   = 'PDF'.
    Please let me know if I am missing anything.
    Regards,
    Nishant

    Hi Nishant,
                   Please refer my below code last week only i have implemented this logic.
    call function 'CONVERT_OTF'
         exporting
           format                = 'PDF'
           max_linewidth         = 132
         importing
           bin_filesize          = w_bin_filesize
         tables
           otf                   = t_otf
           lines                 = t_pdf_tab
         exceptions
           err_max_linewidth     = 1
           err_format            = 2
           err_conv_not_possible = 3
           err_bad_otf           = 4.
    pdf_output[] = t_pdf_tab[].
    loop at pdf_output.
         translate pdf_output using ' ~'.
         concatenate gd_buffer pdf_output into gd_buffer.
       endloop.
       translate gd_buffer using '~ '.
       do.
         it_mess_att = gd_buffer.
         append it_mess_att.
         shift gd_buffer left by 255 places.
         if gd_buffer is initial.
           exit.
         endif.
       enddo.
       ld_email   = p_email.
       ld_mtitle = p_mtitle.
       ld_format              = p_format.
       ld_attdescription      = p_attdescription.
       ld_attfilename         = p_filename.
       ld_sender_address      = p_sender_address.
       ld_sender_address_type = p_sender_addres_type.
    *#Fill the document data.
       w_doc_data-doc_size = 1.
    *#Populate the subject/generic message attributes
       w_doc_data-obj_langu = sy-langu.
       w_doc_data-obj_name  = 'SAPRPT'.
       w_doc_data-obj_descr = ld_mtitle .
       w_doc_data-sensitivty = 'F'.
    *#Fill the document data and get size of attachment
       clear w_doc_data.
       read table it_attach index w_cnt.
       w_doc_data-doc_size =
          ( w_cnt - 1 ) * 255 + strlen( it_attach ).
       w_doc_data-obj_langu  = sy-langu.
       w_doc_data-obj_name   = 'SAPRPT'.
       w_doc_data-obj_descr  = ld_mtitle.
       w_doc_data-sensitivty = 'F'.
       clear t_attachment.
       refresh t_attachment.
       free t_attachment.
       t_attachment[] = it_attach[].
      clear it_attach[].
      refresh  it_attach[].
      free  it_attach[].
    *#Describe the body of the message
       clear t_packing_list.
       refresh t_packing_list.
       t_packing_list-transf_bin = space.
       t_packing_list-head_start = 1.
       t_packing_list-head_num = 0.
       t_packing_list-body_start = 1.
       describe table it_message lines t_packing_list-body_num.
       t_packing_list-doc_type = 'RAW'.
       append t_packing_list.
    *#Create attachment notification
       t_packing_list-transf_bin = 'X'.
       t_packing_list-head_start = 1.
       t_packing_list-head_num   = 1.
       t_packing_list-body_start = 1.
       describe table t_attachment lines t_packing_list-body_num.
       t_packing_list-doc_type   =  ld_format.
       t_packing_list-obj_descr  =  ld_attdescription.
       t_packing_list-obj_name   =  ld_attfilename.
       t_packing_list-doc_size   =  t_packing_list-body_num * 255.
       append t_packing_list.
    *#Add the recipients email address
       clear t_receivers.
       refresh t_receivers.
       free t_receivers.
       clear : email.
       select single usrid_long into email from pa0105 where pernr = wa_pernr-pernr
         and subty = '0010' and seqnr = ''.
       t_receivers-receiver = email.
       t_receivers-rec_type = 'U'.
       t_receivers-com_type = 'INT'.
       t_receivers-notif_del = 'X'.
       t_receivers-notif_ndel = 'X'.
       append t_receivers.
       ld_sender_address = 'HRD1'.
       ld_sender_address_type = 'B'.
       call function 'SO_DOCUMENT_SEND_API1'
            exporting
                 document_data              = w_doc_data
                 put_in_outbox              = 'X'
                 sender_address             = ld_sender_address
                 sender_address_type        = ld_sender_address_type
                 commit_work                = 'X'
            importing
                 sent_to_all                = w_sent_all
            tables
                 packing_list               = t_packing_list
                 contents_bin               = t_attachment
                 contents_txt               = it_message
                 receivers                  = t_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.
    *#Populate zerror return code
       ld_error = sy-subrc.
    *#Populate zreceiver return code
       loop at t_receivers.
         ld_receiver = t_receivers-retrn_code.
       endloop.
    check it and Revert back .
    Regards,
    Thangam.P

  • Email using delimited string

    Hi all,
    Im having trouble when i try to e-mail muliple people using HTML DB.When i enter one email address in the :P25_OWNER field,the email works fine,but when i enter more than one address,no email is send to either.Currently my code looks like this-
    for c1 in (select owner
    from project
    where ID_NUMBER = (select max(ID_NUMBER) from project)) loop
    if c1.owner is not null then
    HTMLDB_MAIL.SEND(
    P_TO => :P25_OWNER,
    P_FROM => :P25_OWNER,
    P_BODY => 'The Project '||:P25_PROJECT_NAME||' has been created '||chr(10)||
    P_SUBJ => 'Project '||:P25_PROJECT_NAME||' has been created');
    end if;
    end loop;
    i also tried returning a string so that i could email the entire string but got the same problem with this-
    DECLARE
    l_string VARCHAR2(255);
    l_vc_arr2 HTMLDB_APPLICATION_GLOBAL.VC_ARR2;
    BEGIN
    l_vc_arr2 := HTMLDB_UTIL.STRING_TO_TABLE(:P25_OWNER);
    l_string := HTMLDB_UTIL.TABLE_TO_STRING(l_vc_arr2);
    HTMLDB_MAIL.SEND(
    P_TO => l_string,
    P_FROM => l_string,
    P_BODY => 'The Project '||:P25_PROJECT_NAME||' has been created '||chr(10)||
    P_SUBJ => 'Project '||:P25_PROJECT_NAME||' has been created');
    END;
    but i had the same problems with this.
    What i want is to have a user enter more than one email address into the text field :P25_OWNER and be able to send an email to each address.Can anyone help with a solution to this problem?
    Thanks,
    Brian.

    Hello Brian,
    i've had a similar problem:
    P_TO:= '[email protected];[email protected]'
    failed. If i use a ',' instead of ';' as delimiter it works fine. So try it like this:
    P_TO:= '[email protected],[email protected]'
    btw, if you use HTMLDB_UTIL.TABLE_TO_STRING you'll get something like this:
    P_TO:= '[email protected]:[email protected]'
    hope it helps
    Thomas

Maybe you are looking for