How to send multiple attachements in single mail

Hi All,
Currently i am using this function module SO_NEW_DOCUMENT_ATT_SEND_API1 to send mail with only one attachment.
But now i need to send multiple attachments to a single mail.
Can any one please tell me as how to send multiple attachments in single mail.
Thanks in advance.

Hi
See this and do accordingly
Mailing with Attachment by ABAP Coding  
Refer this link:
Mail with attachment.
FORM send_list_to_basis .
  DATA: w_path      LIKE rlgrap OCCURS 0 WITH HEADER LINE,
        lt_index    TYPE sy-tabix,
        doc_type(3) TYPE c,
        descr       LIKE it_objpack_basis-obj_descr,
        temp_data   LIKE w_path,
        temp1       TYPE string,
        tab_lines   TYPE i,
        langu(15)   TYPE c,
        expirydate  TYPE so_obj_edt,
        L_FILE1(100).
  CONCATENATE 'C:\' sy-repid '_' sy-datum '.XLS' INTO L_FILE1.
  W_PATH-FILENAME = L_FILE1.
  APPEND w_path.
  CLEAR w_path.
  wa_doc_chng-obj_descr  = 'User List not logged on for 180 days'.
  wa_doc_chng-obj_langu  = 'E'.
  wa_doc_chng-obj_expdat = sy-datum.
  CLEAR w_subject.
  CONCATENATE 'Please find attached document with list of users'
              'not logged on for 180 days for client' sy-mandt
              INTO w_subject SEPARATED BY space.
  it_objtxt_basis-line = w_subject.
  APPEND it_objtxt_basis.
  CLEAR it_objtxt_basis.
  it_objtxt_basis-line = text-004.
  APPEND it_objtxt_basis.
  CLEAR it_objtxt_basis.
  CLEAR w_tab_line.
  DESCRIBE TABLE it_objtxt_basis LINES w_tab_line.
  READ TABLE it_objtxt_basis INDEX w_tab_line  INTO l_cline.
  wa_doc_chng-doc_size =
   ( w_tab_line - 1 ) * 255 + STRLEN( l_cline ).
  CLEAR it_objpack_basis-transf_bin.
  it_objpack_basis-head_start = 1.
  it_objpack_basis-head_num   = 0.
  it_objpack_basis-body_start = 1.
  it_objpack_basis-body_num   = w_tab_line.
  it_objpack_basis-doc_type   = 'RAW'.
  APPEND it_objpack_basis.
  CLEAR it_objpack_basis.
  LOOP AT w_path.
    temp1 = w_path.
    descr = w_path.
    CALL FUNCTION 'STRING_REVERSE'
      EXPORTING
        string  = descr
        lang    = 'E'
      IMPORTING
        rstring = descr.
    CALL FUNCTION 'STRING_SPLIT'
      EXPORTING
        delimiter = '\'
        string    = descr
      IMPORTING
        head      = descr
        tail      = temp_data.
    CALL FUNCTION 'STRING_REVERSE'
      EXPORTING
        string  = descr
        lang    = 'E'
      IMPORTING
        rstring = descr.
    CALL FUNCTION 'STRING_SPLIT'
      EXPORTING
        delimiter = '.'
        string    = descr
      IMPORTING
        head      = temp_data
        tail      = doc_type.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename      = temp1
        filetype      = 'BIN'
        header_length = 0
        read_by_line  = 'X'
        replacement   = '#'
      TABLES
        data_tab      = it_upload.
    DESCRIBE TABLE it_upload LINES tab_lines.
    DESCRIBE TABLE it_objbin_basis LINES lt_index.
    lt_index = lt_index + 1.
    LOOP AT it_upload.
      wa_objbin_basis-line = it_upload-line.
      APPEND wa_objbin_basis TO it_objbin_basis.
      CLEAR wa_objbin_basis.
    ENDLOOP.
    it_objpack_basis-transf_bin = 'X'.
    it_objpack_basis-head_start = 0.
    it_objpack_basis-head_num   = 0.
    it_objpack_basis-body_start = lt_index.
    it_objpack_basis-body_num   = tab_lines.
    it_objpack_basis-doc_type   = doc_type.
    it_objpack_basis-obj_descr  = descr.
    it_objpack_basis-doc_size   = tab_lines * 255.
    APPEND it_objpack_basis.
    CLEAR it_objpack_basis.
  ENDLOOP.
  it_reclist_basis-receiver = '[email protected]'.
  it_reclist_basis-rec_type = 'U'.
  APPEND it_reclist_basis.
  CLEAR it_reclist_basis.
  CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
      document_data              = wa_doc_chng
      put_in_outbox              = 'X'
      commit_work                = 'X'
    TABLES
      packing_list               = it_objpack_basis
      contents_txt               = it_objtxt_basis
      contents_bin               = it_objbin_basis
      receivers                  = it_reclist_basis
    EXCEPTIONS
      too_many_receivers         = 1
      document_not_sent          = 2
      operation_no_authorization = 4
      OTHERS                     = 99.
  IF sy-subrc EQ 0.
    SUBMIT rsconn01 WITH mode = 'INT' AND RETURN.
  ENDIF.
ENDFORM.                    " send_list_to_basis
<b>Reward points for useful Answers</b>
Regards
Anji

Similar Messages

  • How to send multiple attachment in single mail

    i am using FM SO_NEW_DOCUMENT_ATT_SEND_API1 for sending mail.
    pls guide me how can i modify my code so that i can send multiple attachments

    Hi Manish,
    Check out the links below.
    E-mail multiple PDF attachments
    Send a Single Mail with Multiple Attachment
    Hope it helps.
    Regards,
    Amit
    *Always reward points for helpful answers
    Message was edited by:
            Amit Kumar

  • How to send multiple attachment s with a mail??

    Hi,
    How to send multiple attachments  with a mail??
    Situation::
    In my case i have 5 internal tables populated dynamically in the report.
    I want to send them in .TXT format as attachment with 1 mail.
    Can anybody tell me in 'SO_NEW_DOCUMENT_ATT_SEND_API1',
    how we add multiple attachmants to table objin???
    thanks,
    deepak

    Hi Deepak,
    Please find the sample code for sending mail with multiple attachment.
    Report  ZPAN_02M                                        *
    REPORT  zpan_02m                                .
    *-MAIN DECLARATION----
    DATA: docdata    LIKE sodocchgi1,
          objpack    LIKE sopcklsti1 OCCURS  1 WITH HEADER LINE,
          objhead    LIKE solisti1   OCCURS  1 WITH HEADER LINE,
          objtxt     LIKE solisti1   OCCURS 10 WITH HEADER LINE,
          objbin     LIKE solisti1   OCCURS 10 WITH HEADER LINE,
          objhex     LIKE solix      OCCURS 10 WITH HEADER LINE,
          reclist    LIKE somlreci1  OCCURS  1 WITH HEADER LINE.
    *-OTHER DECLARATIONS----
    DATA : listobject   LIKE abaplist OCCURS  1 WITH HEADER LINE.
    DATA : tab_lines(3) TYPE n.
    DATA : att_type     LIKE soodk-objtp.
    *OBJBIN = '  |  '. APPEND OBJBIN.
    *---For simple attachment -
    DATA : BEGIN OF wi_data OCCURS 0,
             c1(10),
             c2(10),
           END OF wi_data.
    wi_data-c1 = 'Line 1'.   wi_data-c2 = 'Line 1'.  APPEND wi_data.
    wi_data-c1 = 'Line 2'.   wi_data-c2 = 'Line 2'.  APPEND wi_data.
    wi_data-c1 = 'Line 3'.   wi_data-c2 = 'Line 3'.  APPEND wi_data.
    wi_data-c1 = 'Line 4'.   wi_data-c2 = 'Line 3'.  APPEND wi_data.
    wi_data-c1 = 'Line 5'.   wi_data-c2 = 'Line 3'.  APPEND wi_data.
    wi_data-c1 = 'Line 6'.   wi_data-c2 = 'Line 3'.  APPEND wi_data.
    wi_data-c1 = 'Line 7'.   wi_data-c2 = 'Line 3'.  APPEND wi_data.
    wi_data-c1 = 'Line 8'.   wi_data-c2 = 'Line 3'.  APPEND wi_data.
    wi_data-c1 = 'Line 9'.   wi_data-c2 = 'Line 3'.  APPEND wi_data.
    wi_data-c1 = 'Line 10'.   wi_data-c2 = 'Line 3'.  APPEND wi_data.
    wi_data-c1 = 'Line 11'.   wi_data-c2 = 'Line 3'.  APPEND wi_data.
    wi_data-c1 = 'Line 12'.   wi_data-c2 = 'Line 3'.  APPEND wi_data.
    wi_data-c1 = 'Line 13'.   wi_data-c2 = 'Line 3'.  APPEND wi_data.
    wi_data-c1 = 'Line 14'.   wi_data-c2 = 'Line 3'.  APPEND wi_data.
    wi_data-c1 = 'Line 15'.   wi_data-c2 = 'Line 3'.  APPEND wi_data.
    wi_data-c1 = 'Line 16'.   wi_data-c2 = 'Line 3'.  APPEND wi_data.
    wi_data-c1 = 'Line 17'.   wi_data-c2 = 'Line 3'.  APPEND wi_data.
    wi_data-c1 = 'Line 18'.   wi_data-c2 = 'Line 3'.  APPEND wi_data.
    wi_data-c1 = 'Line 19'.   wi_data-c2 = 'Line 3'.  APPEND wi_data.
    wi_data-c1 = 'Line 20'.   wi_data-c2 = 'Line 3'.  APPEND wi_data.
    wi_data-c1 = 'Line 21'.   wi_data-c2 = 'Line 3'.  APPEND wi_data.
    wi_data-c1 = 'Line 22'.   wi_data-c2 = 'Line 3'.  APPEND wi_data.
    wi_data-c1 = 'Line 23'.   wi_data-c2 = 'Line 3'.  APPEND wi_data.
    wi_data-c1 = 'Line 24'.   wi_data-c2 = 'Line 3'.  APPEND wi_data.
    wi_data-c1 = 'Line 25'.   wi_data-c2 = 'Line 3'.  APPEND wi_data.
    wi_data-c1 = 'Line 26'.   wi_data-c2 = 'Line 3'.  APPEND wi_data.
    class cl_abap_char_utilities definition load.
    constants:
        con_tab  type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
        con_cret type c value cl_abap_char_utilities=>CR_LF,
        con_nwln type c value cl_abap_char_utilities=>NEWLINE.
    LOOP AT wi_data.
      CONCATENATE wi_data-c1 con_tab
                  wi_data-c2
                INTO objbin.
      condense objbin.
      CONCATENATE con_cret objbin INTO objbin.
      APPEND  objbin.
    ENDLOOP.
    *---CREATE MESSAGE : DOCDATA -
      Name
    docdata-obj_name  = 'TEST_ALI'.
      Subject
    docdata-obj_descr = 'Test including ALI/HTML Attachment'.
    *---CREATE MESSAGE : BODY -
    objtxt = 'Test Document.'.
    APPEND objtxt.
    objtxt = 'You will find an ALI/HTML attachment in this message.'.
    APPEND objtxt.
    objtxt = 'Have a nice day.'.
    APPEND objtxt.
    *-CREATE PACKING LIST-----TEXT--
    objpack-head_start = 1.
    DESCRIBE TABLE objtxt LINES tab_lines.
    READ     TABLE objtxt INDEX tab_lines.
    docdata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
    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.
    *-CREATE PACKING LIST-----ATTACHMENT--
    att_type = 'XLS'.
    DESCRIBE TABLE objbin LINES tab_lines.
    READ     TABLE objbin INDEX tab_lines.
    objpack-doc_size = ( ( tab_lines / 2 ) - 1 ) * 255 + STRLEN( objbin ).
    objpack-transf_bin = 'X'.
    objpack-head_start = 1.
    objpack-head_num   = 0.
    objpack-body_start = 1.
    objpack-body_num   = tab_lines / 2.
    objpack-doc_type   = att_type.
    objpack-obj_name   = 'ATTACHMENT 1'.
    objpack-obj_descr  = 'Attached Document 1'.
    APPEND objpack.
    att_type = 'XLS'.
    objpack-doc_size = ( ( tab_lines / 2 ) - 1 ) * 255 + STRLEN( objbin ).
    objpack-transf_bin = 'X'.
    objpack-head_start = 14.
    objpack-head_num   = 14.
    objpack-body_start = 14.
    objpack-body_num   = tab_lines / 2.
    objpack-doc_type   = att_type.
    objpack-obj_name   = 'ATTACHMENT 2'.
    objpack-obj_descr  = 'Attached Document 2'.
    APPEND objpack.
    *-CREATE RECEIVER LIST----
    reclist-receiver = '[email protected]'. reclist-rec_type = 'U'.
    APPEND reclist.
    reclist-receiver = sy-uname.               reclist-rec_type = 'B'.
    APPEND reclist.
    *-SEND MESSAGE----
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
      EXPORTING
        document_data                     = docdata
        put_in_outbox                     = 'X'
        commit_work                       = 'X'
      IMPORTING
      SENT_TO_ALL                       =
      NEW_OBJECT_ID                     =
      TABLES
        packing_list                      = objpack
        object_header                     = objhead
        contents_bin                      = objbin
        contents_txt                      = objtxt
      CONTENTS_HEX                      = objhex
      OBJECT_PARA                       =
      OBJECT_PARB                       =
        receivers                         = reclist
       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.
    WAIT UP TO 2 SECONDS.
    SUBMIT rsconn01 WITH mode = 'INT'
                  WITH output = 'X'
                  AND RETURN.
    Hope this is enough for you...
    Enjoy SAP.
    Pankaj Singh.

  • How to Send Multiple Attachment by SOAP Adapter

    Hi,
    How to send multiple attachment by SOAP Adapter.
    I am able to send single attachment but at the time of sending multiple attachment i am not able to see in SXMB_moni.
    Regards,
    Anurag

    On the communication channel, please check the 'Do Not Use SOAP envelope' option. Also, please, add the "nosoap" attribute to the SOAP adapter caller. Check the note below for more information
    #856597 FAQ: XI 3.0 / PI 7.0 / PI 7.1 SOAP Adapter
    > "How does the nosoap mode work for the SOAP sender adapter?"

  • How to send multiple Recipients using the mail.jar and activation.jar

    hi!
    could somebody help me. how do i send multiple Recipient using mail.jar. when i would input 2email address in to Recipient
    (example: [email protected], [email protected])
    i get a DEBUG: setDebug: JavaMail version 1.3.2
    but if i send a single email it just works properly.
    heres my code
    import java.io.*;
    import java.util.*;
    import javax.mail.*;
    import javax.mail.event.*;
    import javax.mail.internet.*;
    public class SendMail
              public SendMail(String to, String from, String subject, String body)
              //public SendMail(String to)
                   String message_recip = to;
                   String message_subject = subject;
                   String message_cc = "";
                   String message_body = body;
                   //The JavaMail session object
                   Session session;
                   //The JavaMail message object
                   Message mesg;
                   // Pass info to the mail server as a Properties, since JavaMail (wisely) allows room for LOTS of properties...
                   Properties props = new Properties( );
                   // LAN must define the local SMTP server as "mailhost" to be able to send mail...
                   //props.put("mail.smtp.host","true");
                   props.put("mail.smtp.host", "mailhost");
                   // Create the Session object
                   session = Session.getDefaultInstance(props, null);
                   session.setDebug(true);
                   try
                        // create a message
                        mesg = new MimeMessage(session);
                        // From Address - this should come from a Properties...
                        mesg.setFrom(new InternetAddress(from));
                        // TO Address
                        InternetAddress toAddress = new InternetAddress(message_recip);
                        mesg.addRecipient(Message.RecipientType.TO, toAddress);
                        // CC Address
                        InternetAddress ccAddress = new InternetAddress(message_cc);
                        mesg.addRecipient(Message.RecipientType.CC, ccAddress);
                        // The Subject
                        mesg.setSubject(message_subject);
                        // Now the message body.
                        mesg.setText(message_body);
                        // XXX I18N: use setText(msgText.getText( ), charset)
                        // Finally, send the message!
                        Transport.send(mesg);
                   }//end of try
                   catch (MessagingException ex)
                        while ((ex = (MessagingException)ex.getNextException( )) != null)
                             ex.printStackTrace( );
                        }//end of while
              }//end of catch
         }//end of SendMail
    public static void main(String[] args)
              //String t = "[email protected], [email protected]"; - this I think causes error
    String t = "[email protected]";
              String f = "[email protected]";
              String s = "Hello World";
              String b = "the quick brown fox jumps over the lazy dog";
              SendMail sm = new SendMail(t,f,s,b);     
         }//end of main
    }//end of class
    could someone please help me im stuck-up with this. thanx!

    i need it ASAP
    i am a beginner in java and jsp
    Need to knw how can I parse the addresss field
    Below
    is the code
    <code>
    package
    public class EMailBean {
    private String smtp,username,password,from,bcc,subject,body,attachments,cc;
         /*setter*/
         public void setSmtp(String str){this.smtp=str;}
         public void setUsername(String str){this.username=str;}
         public void setPassword(String str){this.password=str;}
         public void setFrom(String str){this.from=str;}
         public void setTo(String str){this.to=str;}
         public void setCc(String str){this.cc=str;}
         public void setBcc(String str){this.bcc=str;}
         public void setSubject(String str){this.subject=str;}
         public void setBody(String str){this.body=str;}
         public void setAttachments(String str){this.attachments=str;}
                                  /*getter*/
         public String getSmtp( ){return this.smtp;}
         public String getUsername( ){return this.username;}
         public String getPassword( ){return this.password;}
         public String getFrom( ){return this.from;}
         public String getTo( ){return this.to;}
         public String getCc( ){return this.cc;}     
         public String getBcc( ){return this.bcc;}
         public String getSubject( ){return this.subject;}
         public String getBody( ){return this.body;}
    public String getAttachments( ){return this.attachments;}
    </code>
    Session session = Session.getDefaultInstance(props, null);
    session.setDebug(true);
    try {
    MimeMessage msg = new MimeMessage(session);
    msg.setFrom(new InternetAddress(mail.getFrom()));
                                  msg.addRecipients(Message.RecipientType.TO, InternetAddress.parse(to, false));
                                  msg.addRecipient(Message.RecipientType.TO,new InternetAddress(mail.getTo()));
                             msg.addRecipient(Message.RecipientType.CC, new InternetAddress(mail.getCc()));
                                  msg.addRecipient(Message.RecipientType.CC, new InternetAddress("[email protected]"));
    msg.setSubject(mail.getSubject());
    // Create the message part
    BodyPart messageBodyPart = new MimeBodyPart();
    // Fill the message
    messageBodyPart.setText(mail.getBody());
    Multipart multipart = new MimeMultipart();
    multipart.addBodyPart(messageBodyPart);
    // Part two is attachment
    messageBodyPart = new MimeBodyPart();
    DataSource source = new FileDataSource(mail.getAttachments());
    messageBodyPart.setDataHandler(new DataHandler(source));
    messageBodyPart.setFileName(source.getName());
    multipart.addBodyPart(messageBodyPart);
    msg.setContent(multipart);
    msg.setSentDate(new Date());
    Transport t = session.getTransport("smtp");
    try {
    t.connect(mail.getUsername(), mail.getPassword());
    t.sendMessage(msg, msg.getAllRecipients());
    } finally {
    t.close();
    result = result + "<FONT SIZE='4' COLOR='blue'><B>Success!</B>"+"<FONT SIZE='4' COLOR='black'> "+"<HR><FONT color='green'><B>Mail was successfully sent to </B></FONT>: "+mail.getTo()+"<BR>";
    if (!("".equals(mail.getCc())))
    result = result +"<FONT color='green'><B>CCed To </B></FONT>: "+mail.getCc()+"<BR>";
    if (!("".equals(mail.getBcc())))
    result = result +"<FONT color='green'><B>BCCed To </B></FONT>: "+mail.getBcc() ;
    result = result+"<BR><HR>";
    } catch (MessagingException mex) {
    result = result + "<FONT SIZE='4' COLOR='blue'> <B>Error : </B><BR><HR> "+"<FONT SIZE='3' COLOR='black'>"+mex.toString()+"<BR><HR>";
    } catch (Exception e) {
    result = result + "<FONT SIZE='4' COLOR='blue'> <B>Error : </B><BR><HR> "+"<FONT SIZE='3' COLOR='black'>"+e.toString()+"<BR><HR>";
    e.printStackTrace();
    finally {
    return result;
    }

  • Sending multiple reports thru single mail in Crystal reports server XI R2

    2)
    Ex:
    I have a crystal report  which takes country as input parameter. Each country has one responsible person.
    US--- A person
    UK---B person
    INDIA ---C person
    I need to run this report with these three paramters(may increase infuture) and send the exported report to A,B and C as an mail attachment through crystal reports server XI R2.
    I have achieved above with Java code and deployed that java code as JAR file in crystal reports server and scheduled this JAR file.
    Here I need to attach all these three attachments to single mail and send it to Manager. And also I need to wait till all the reports gets executed and then attach all the attachments to single mail.
    Please help me how to achieve this.
    I am using --- Crystal reports server XI R2
    Thanks,
    Vijay Kanth

    How are you creating the first three files, are you scheduling each to smtp, or are you waiting until they finish and emailing the instance through your jar file?
    If you are scheduling each one, and the instance in enterprise keeps a copy of the finished report, then you could monitor the status of the 3 jobs, once all finish you could get the report and email them out through your java code.  There wouldn't be a way to email all three reports as one email to the manager directly through the product.  You would be able to cc or bcc the manager on each, but then the manager would be receiving 3 emails.

  • How to send multiple attachments with the mail in jsp

    hi.I wrote a code to send mail.but i need to send mail with multiple attachments.when i run this code iam able to send message but not files.i want to send files as attachments with the message.please help me.
    <%@ page import="javax.mail.*,javax.mail.internet.*,java.util.Date,java.io.*,java.net.InetAddress,java.sql.*,java.util.Properties,java.net.*,javax.sql.*,javax.activation.*,java.util.*,java.text.*" %>
    <%@ page import="java.io.*,java.sql.*,java.net.*,java.util.*,java.text.*" %>
    <%
         String Attachfiles1="";
         String Attachfiles2="";
    String Attachfiles3="";
    if("Send".equalsIgnoreCase("send"))
    try
    String subject="",from="",url = null,to="";
    String mailhost = "localhost";
    Properties props = System.getProperties();
    String msg_txt="";
    String strStatus="";
    String mailer = "MyMailerProgram";
    to=request.getParameter("to");
    from=request.getParameter("from");
    subject=request.getParameter("subject");
    msg_txt=request.getParameter("message");
    props.put("mail.smtp.host", mailhost);
    Session mailsession = Session.getDefaultInstance(props, null);
    Message message = new MimeMessage(mailsession);
    message.setFrom(new InternetAddress(from));
    message.setRecipients(Message.RecipientType.TO,InternetAddress.parse(to, false));
    message.setSubject(subject);
    message.setHeader("X-Mailer", mailer);
    message.setSentDate(new Date());
    message.setText(msg_txt);
    BodyPart messageBodyPart = new MimeBodyPart();
    BodyPart messageBodyPart2 = new MimeBodyPart();
    Multipart multipart = new MimeMultipart(); // to add many part to your messge
    messageBodyPart = new MimeBodyPart();
    javax.activation.DataSource source = new javax.activation.FileDataSource("path of the file");
    messageBodyPart.setDataHandler(new DataHandler(source));
    messageBodyPart.setFileName("file_name");
    messageBodyPart2.setText("message"); // set the txt message
    multipart.addBodyPart(messageBodyPart);
    multipart.addBodyPart(messageBodyPart2);
    Transport.send(message);
    out.println("Message Sent");
    catch (Exception e)
    e.printStackTrace();
    if("Attachfiles".equalsIgnoreCase("attachfiles"))
    Attachfiles1=request.getParameter("fieldname1");
    Attachfiles2=request.getParameter("fieldname2");
    Attachfiles3=request.getParameter("fieldname3");
    %>
    <html>
    <body>
    <div class="frame">
    <form action="Composemail.jsp" method="post">
    <b>SelectPosition:</b> <select name="cars" >
    <option value="ABAP">ABAP
    <option value="saab">Saab
    <option value="fiat">Fiat
    <option value="audi">Audi
    </select><br><br>
    <table border="1" cellpadding="2" cellspacing="2">
    <tr><th>Name</th>
    <th>EmailId</th>
    <th>ContactNumber</th>
    <th>Position</th>
    </tr>
    <tr>
    <td>
    </td>
    </tr>
    </table><br>
    <b>SelectUser :</b><select name="cars">
    <option value="Administrator">Administrator
    <option value="saab">Saab
    <option value="fiat">Fiat
    <option value="audi">Audi
    </select>
    <br>
    <b>To :</b>�����������<input type="text" name="to" size="72"><br>
    <b>From :</b>�������<input type="text" name="from" size="72"><br>
    <b>Subject :</b>���<input type="text" name="subject" size="72"><br>
    <%=Attachfiles1%><br><%=Attachfiles2%><br><%=Attachfiles3%><br><br>
    <b>Message:</b><br>
    ������������<textarea rows="10" cols="50" name="message">
    </textarea> <br><br>
    <b>AttachedFile:</b>�<input type="file" name="fieldname1" value="filename" size="50"><br><br>
    <b>AttachedFile:</b>�<input type="file" name="fieldname2" value="filename" size="50"><br><br>
    <b>AttachedFile:</b>�<input type="file" name="fieldname3" value="filename" size="50"><br><br>
    ������������<input type="submit" name="attachfiles" value="Attachfiles">
    <center>
    <input type="submit" name="send" value="Send" >
    </center>
    </form>
    </div>
    </body>
    </html>

    Most likely you're not specifying the path of a file on the server machine.

  • Sending Multiple attachements (PDF) in a single email

    Hello All,
    I came across below link but could not understand.
    How to send multiple attachements in single mail
    Any idea how i can send email with Multiple attachements (PDF format files). Thanks.

    Smart Form PDF Link
    http://help.sap.com/bp_presmartformsv1500/DOCU/OVIEW_EN.PDF
    http://sap.ionelburlacu.ro/sap0/sapsf001.htm
    http://help.sap.com/saphelp_erp2004/helpdata/en/a9/de6838abce021ae10000009b38f842/frameset.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/a5/de6838abce021ae10000009b38f842/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/16/a369b1800e4bdda978ee0fe3b7bd2c/content.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/a5/de6838abce021ae10000009b38f842/content.htm
    http://www.sap-basis-abap.com/sapsf001.htm
    http://www.sap-img.com/smartforms/smart-001.htm
    Rewards if useful................
    Minal

  • How to attach Multiple attachments to single mail

    How to attach multiple pdfs to single mail  ?
    or
    how to attach one pdf & One excel & One word document to single mail ?
    Thanks In Advance

    Hello Karunya,
    Please refer to the link below.
    https://wiki.sdn.sap.com/wiki/display/Snippets/Send%20email%20with%20multiple%20zipped%20attachments
    Regards,
    P Bansal

  • How to send an attachment thru mail in SAP?

    Hi all,
    I have an file which has been sent by the customer. The file type may vary each & every week (sometimes XLS, sometimes CSV & sometimes notepad). This file has to be sent to another person thru mail as an attachment.
    Is it possible to send thru the fun mod 'SO_SEND_NEW_*'.
    If so how to send as attachment. If not thru this fun mod, how to send?
    Thanks,
    Vijay.

    I am enclosing the sample code to trigger an email, The logic for this is in comments, check this I am shure yuor problem will be solved.
    *& Report ZGBL_SLA_PER
    REPORT zgbl_sla_per NO STANDARD PAGE HEADING LINE-COUNT 26(3) MESSAGE-ID
    zmsg2.
    DECLARATION OF DB TABLES
    TABLES: zncrfid, zrule_id.
    DECLARATION OF INTERNAL TABLES
    DATA: BEGIN OF ncrf OCCURS 0,
    zncrf_id(15) TYPE c,
    zncrf_l4_name(60) TYPE c,
    z9gl_sla_flag(1) TYPE c,
    zowners(30) TYPE c,
    zowners_value(30) TYPE c,
    zdate_changed(8) TYPE n,
    ztime_changed(6) TYPE n,
    END OF ncrf.
    *DATA: NCRF LIKE ZNCRFID OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN OF it_ruleid OCCURS 0,
    zrule_id(10) TYPE c,
    zowners(30) TYPE c,
    zowners_value(30) TYPE c,
    END OF it_ruleid.
    *data: wa like ncrf occurs 0 with header line.
    DATA: BEGIN OF itab OCCURS 0,
    zncrf_id(15) TYPE c,
    zncrf_l4_name(60) TYPE c,
    z9gl_sla_flag(1) TYPE c,
    zowners(30) TYPE c,
    zowners_value(30) TYPE c,
    zdate_changed(8) TYPE n,
    ztime_changed(6) TYPE n,
    END OF itab.
    data: file(10) type c,
    dates type date.
    EMAIL DECLARATION
    *CONSTANTS: c_subject LIKE sodocchgi1-obj_descr VALUE 'Subject',
    *c_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.
    *DATA: g_time TYPE char8,
    *g_email(40) TYPE c,
    *g_sent_all(1) TYPE c,
    *g_doc_data LIKE sodocchgi1,
    *g_error TYPE sy-subrc.
    *DATA: i_message LIKE solisti1 OCCURS 0 WITH HEADER LINE,
    *i_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
    *i_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE.
    *DATA: BEGIN OF mailid OCCURS 0,
    zemail_id TYPE zrule_id-zemail_id,
    END OF mailid.
    *data: mailid like zrule_id occurs 0 with header line.
    UPLOADING FLAT FILE TO INTERNAL TABLE NCRF
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = 'C:\VAMSY\file.txt'
    filetype = 'ASC'
    has_field_separator = 'X'
    HEADER_LENGTH = 0
    READ_BY_LINE = 'X'
    DAT_MODE = ' '
    CODEPAGE = ' '
    IGNORE_CERR = ABAP_TRUE
    REPLACEMENT = '#'
    CHECK_BOM = ' '
    IMPORTING
    FILELENGTH =
    HEADER =
    TABLES
    data_tab = ncrf[]
    EXCEPTIONS
    FILE_OPEN_ERROR = 1
    FILE_READ_ERROR = 2
    NO_BATCH = 3
    GUI_REFUSE_FILETRANSFER = 4
    INVALID_TYPE = 5
    NO_AUTHORITY = 6
    UNKNOWN_ERROR = 7
    BAD_DATA_FORMAT = 8
    HEADER_NOT_ALLOWED = 9
    SEPARATOR_NOT_ALLOWED = 10
    HEADER_TOO_LONG = 11
    UNKNOWN_DP_ERROR = 12
    ACCESS_DENIED = 13
    DP_OUT_OF_MEMORY = 14
    DISK_FULL = 15
    DP_TIMEOUT = 16
    OTHERS = 17
    IF sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ELSE.
    IF sy-subrc EQ 0.
    Checking internal table ncrf is empty then
    *delete records from TABLE ZNCRF_ID ******************************
    IF ncrf[] IS INITIAL.
    MESSAGE i003(ZMSG2).
    ELSE.
    DELETE FROM zncrfid.
    ENDIF.
    *****Values are read from rule table and checking owner and owner_value
    *from zrule_id table and inserted into ZNCRFID **************
    SELECT * FROM zrule_id INTO CORRESPONDING FIELDS OF TABLE it_ruleid
    WHERE zrule_id IN ('OWNER1', 'OWNER2').
    append IT_RULEID.
    LOOP AT ncrf WHERE z9gl_sla_flag EQ 'Y'.
    READ TABLE it_ruleid WITH KEY zowners = ncrf-zowners
    zowners_value = ncrf-zowners_value.
    IF ncrf-zowners = it_ruleid-zowners AND ncrf-zowners_value =
    it_ruleid-zowners_value AND ncrf-z9gl_sla_flag ='Y'.
    itab-zncrf_id = ncrf-zncrf_id.
    itab-zncrf_l4_name = ncrf-zncrf_l4_name.
    itab-z9gl_sla_flag = ncrf-z9gl_sla_flag.
    itab-zdate_changed = sy-datum.
    itab-ztime_changed = sy-uzeit.
    itab-zowners = it_ruleid-zowners.
    itab-zowners_value = it_ruleid-zowners_value.
    APPEND itab.
    ENDIF.
    ENDLOOP.
    modify database table zncrfid FROM ITAB
    LOOP AT itab.
    WRITE:/ itab-zncrf_id, itab-zncrf_l4_name, itab-z9gl_sla_flag,
    itab-zowners, itab-zowners_value, itab-zdate_changed,
    itab-ztime_changed.
    zncrfid-zncrf_id = itab-zncrf_id.
    zncrfid-zncrf_l4_name = itab-zncrf_l4_name.
    zncrfid-z9gl_sla_flag = itab-z9gl_sla_flag.
    zncrfid-zowners = itab-zowners.
    zncrfid-zowners_value = itab-zowners_value.
    zncrfid-zdate_changed = itab-zdate_changed.
    zncrfid-ztime_changed = itab-ztime_changed.
    INSERT INTO zncrfid VALUES zncrfid.
    ENDLOOP.
    ENDIF.
    ENDIF.
    *CALL FUNCTION 'DATE_TO_DAY'
    EXPORTING
    DATE = sy-datum
    IMPORTING
    WEEKDAY = file.
    **CHECKING FOR THE FIRST MONDAY OF THE MONTH.
    dates = sy-datum.
    shift dates by 6 places left.
    if file CO 'monday' and dates < 7 and dates >= 1.
    else.
    message e004(zmsg2).
    endif.
    EMAIL SEND TO OWNERS LIST
    **Fill the mail body in i_message.
    get email id's from database into internal table et_mailid
    Fill the document data.
    *g_doc_data-doc_size = 1.
    Populate the subject/generic message attributes
    *g_doc_data-obj_langu = sy-langu.
    *g_doc_data-obj_name = 'SAPRPT'.
    *g_doc_data-obj_descr = c_subject .
    *g_doc_data-sensitivty = 'F'.
    Describe the body of the message
    Information about structure of data tables
    *CLEAR i_packing_list.
    *REFRESH i_packing_list.
    *i_packing_list-transf_bin = space.
    *i_packing_list-head_start = 1.
    *i_packing_list-head_num = 0.
    *i_packing_list-body_start = 1.
    *DESCRIBE TABLE i_message LINES i_packing_list-body_num.
    *i_packing_list-doc_type = 'RAW'.
    *APPEND i_packing_list.
    Add the recipients email address
    *LOOP AT mailid.
    *CLEAR i_receivers.
    *i_receivers-receiver = mailid-zemail_id.
    *i_receivers-rec_type = 'U'.
    *i_receivers-com_type = 'INT'.
    *i_receivers-notif_del = 'X'.
    *i_receivers-notif_ndel = 'X'.
    *APPEND i_receivers.
    *ENDLOOP.
    Call the FM to post the message to SAPMAIL
    *CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    *EXPORTING
    *document_data = g_doc_data
    *put_in_outbox = 'X'
    *commit_work = 'X'
    *IMPORTING
    *sent_to_all = g_sent_all
    *TABLES
    *packing_list = i_packing_list
    *contents_txt = i_message
    *receivers = i_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
    *g_error = sy-subrc.
    Get i_receivers return code
    *LOOP AT i_receivers.
    *ENDLOOP.
    **Instructs mail send program for SAPCONNECT to send email(rsconn01)
    *WAIT UP TO 2 SECONDS.
    *IF g_error EQ 0.
    *SUBMIT zgbl_sla_per WITH mode = 'INT'
    *WITH output = 'X'
    *AND RETURN.
    REWARD IF FOUND USEFULL,
    Cheers,

  • How to send multiple data for a single element

    Hi All,
    I have a requirement where I have to send multiple data for single element per single transaction. For example
    Id details
    1 abcd
    1 efgh
    1 def
    Now, when I am selecting this ID from database, I have to get all the details in a single xsd like
    <id>1</id>
    ---><details>abcd</details>
    <details>efgh</details>
    <details>def</details>
    Thanks

    Hi,
    The following XSLT...
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:template match="/">
    <xsl:variable name="root" select="/"/>
    <root>
    <xsl:for-each select="distinct-values(/root/entry/id)">
    <xsl:variable name="id" select="."/>
    <entry>
    <id><xsl:value-of select="$id"/></id>
    <xsl:for-each select="$root/root/entry[id = $id]">
    <details><xsl:value-of select="details"/></details>
    </xsl:for-each>
    </entry>
    </xsl:for-each>
    </root>
    </xsl:template>
    </xsl:stylesheet>Will work for a document like this...
    <root>
    <entry>
    <id>1</id>
    <details>detail1</details>
    </entry>
    <entry>
    <id>1</id>
    <details>detail2</details>
    </entry>
    <entry>
    <id>2</id>
    <details>detail3</details>
    </entry>
    </root>Hope this helps...
    Cheers,
    Vlad

  • Send few attachment at one mail via Abap

    Hi.
    How can send few attachments in one mail threw Abap?
    I know how to send files but how can I attach few files in one mail ?
    Thanks all,
    Rebeka

    Hi,
    Tthe following piece of logic is required to send multiple attachments in one mail.
    Loop
    * Creating the entry for the compressed attachment
            IF gv_count = 1.
              gi_objpack-head_start = 1.
              gi_objpack-head_num   = 1.
              gi_objpack-body_start = 1.
              DESCRIBE TABLE gi_objbin LINES gv_no_lines.
              gi_objpack-body_num   = gv_no_lines.
              gi_objpack-doc_size   = gv_no_lines * 255.
              gi_objpack-transf_bin = gc_x.
              gi_objpack-doc_type   = gc_pdf.
              gi_objpack-obj_name   = text-037.
              CONCATENATE text-038 gw_doc_id-object_id(10)
              INTO gi_objpack-obj_descr.
              APPEND gi_objpack.
            ELSEIF gv_count > 1.
              gi_objpack-head_start = gv_no_lines + 1.
              gi_objpack-head_num   = gv_no_lines + 1.
              gi_objpack-body_start = gv_no_lines + 1.
              DESCRIBE TABLE gi_upload LINES gv_no_lines.
              gi_objpack-body_num   = gv_no_lines.
              gi_objpack-doc_size   = gv_no_lines * 255.
              gi_objpack-transf_bin = gc_x.
              gi_objpack-doc_type   = gc_pdf.
              gi_objpack-obj_name   = text-037.
              CONCATENATE text-038 gw_doc_id-object_id(10)
              INTO gi_objpack-obj_descr.
              APPEND gi_objpack.
              DESCRIBE TABLE gi_objbin LINES gv_no_lines.
            ENDIF.
      Endloop.
    Each record in gi_objpack is an attachment, say suppose 3 records are there, then it means 3 attachments.
    gi_objbin is the attachment content, here it is a PDF File.
    Hope u know about this FM 'SO_NEW_DOCUMENT_ATT_SEND_API1' and remaining details to pass to this FM.
    Thanks,
    Srilakshmi.

  • How to send multiple docs in soa suite 10g ?

    Hi All ,
    I am using Soa Suite 10g (10.1.1.3).
    I had a requirement to send multiple docs for single id. say for example, i have table emp and document and for single empid field i have multiple documents. i need to transform in such a way that details from emp along with multiple documents for the corresponding empid
    in emp table i have : empname , empid, dept, place
    in document table i have : empid1 document1,document2 , empid1 document3,document4
    means for the same emp id , i have two documents rows.
    I dont want send emp details multiple times, but for the single emp details i need to send multiple docs.
    say empid1,empname,dept,place and document1,document2,document3,document4
    i use transformation, multiple docs are not transforming, second details overiding my fitrst transformation.
    plese help me , how can i send multiple docs to another service
    Thanks in advance

    Hi,
    I must say that your explanation of your problem is a little fuzzy. But as far as I understand it, you would need an xsd of your external service with a list of documents per employee.
    The more or less simplest/straightforward way to do it is using a loop in BPEL. Then within an assign in the loop you could do:
    <copy>
    <from variable="inputVariable"
    query="/ns1:a/ns1:b/ns1:c"
    part="payload"/>
    <to variable="ServiceDocumentProperty"
    query="/ns22:Property/ns22:value"/>
    </copy>
    <bpelx:append>
    <bpelx:from variable="ServiceDocumentProperty"/>
    <bpelx:to variable="lServiceDocumentPropertyList"
    query="/ns22:PropertyList"/>
    </bpelx:append>
    I think you could do it as well in a transform, but then you should create a (set of) custom templates that traverses the source list of documents in a recursive way. For some examples you could read this article: http://blog.darwin-it.nl/2013/02/sending-and-saving-emails-in-soasuite.html. Because the difficulty in your case is (as I understand correctly) you have a detail table with 2 documents per row. What would be more logical and simpeler is if you would had 1 document per child-row.
    If you could redesign your source-model into a single document per row, then in the xslt-transform you could do just the for-each construct.
    Regards,
    Martien

  • How to select multiple recipients in iPad mail

    I have read that I can't create groups, but how to select multiple recipients in iPad mail?
    I was looking for this when setting up for two new people who are going to have the iPad as their only device.. and they do need to email a bunch of people at once..
    I was sending out the 'I have a new email address' BCC for them.
    Thanks.

    You can select multiple contacts by tapping on the + sign in the upper right corner in the To: field when you are typing a new email. Just keep tapping the + sign and your contacts will pop up in a window. Select the contact that you want to add, repeat the process in order to add as many recipients as you want.
    There are other mail apps that let you creat groups and email to those groups.
    https://itunes.apple.com/us/app/group-email!-mail-client-attachments/id380690305 ?l=es&mt=8
    https://itunes.apple.com/us/app/mailshot-pro-group-email-done/id445996226?mt=8
    I am sure there are other, but those are two that I know of.

  • How to send multiple customer statements by email using RFKORD11 program.

    Hi All,
    How to send multiple customer statements by email using RFKORD11 program. Is it possible?
    As of now we copied the stanadard program and sending the customer statements by email, one by one.
    if i execute the z program it will show the customer statement and send mail option.
    if i click send mail it will send that customer statement to the corresponding customer.
    then again i need to click back, it will show next customer statement and click on send mail.
    Pl guide me, if any one worked on this program.
    thanks in advance.
    Regards,
    Mahesh

    Try execute the program in the background to see if that helps.

Maybe you are looking for

  • Out of memory: Java heap space

    Hello, I am working on a project, that simulates large populations, with each individual being a separate Objecta(a couple of kilobytes in size each). Once i reach a bug enough number of those Objects (stored in a Vector), i get Out of memory: Java h

  • CS4 will not work with Snow Leopard

    Does anyone know what the problem is? I have been reading on other message boards about CS4 programs crashing. I can't even get mine to open. Does anyone know a fix or something that can help?

  • JDialog boxes aren't drawing properly

    Hi I'm busy designing the front end for my final year project at uni (on Netbeans 5.5, although I doubt the problem is due to that), and I've suddenly started getting some strange problems with dialog boxes (seems to be since updating to Java 1.6 SDK

  • Need help for query

    I have Table1 ID -- Key -- Name -- City 1--R1--abc--xyz 2--R1--abc--xyz 3--R1--pqr--xyz 4--R1--abc--xyz 5--R1--abc--stp 6--R2--abc1--xyz1 7--R2--abc1--xyz1 8--R2--pqr1--xyz1 9--R2--abc1--xyz1 10--R2--abc1--stp1 I want to get result - Max(ID) where Ke

  • Comma separated column into rows for each value

    experts, I have a two column table. The second column has comma separated string values. How can I put the values separate for each comma separated and make one row for each value? example, column1 |   StringColumn s1          |   test, joy, happy s2