Simple mail program

dear friends , i am new to this api and i tried to execute one simple program , which compiled well , but reported exception , it was some thing related to host i am attaching the source code, the problem it related to String host and string from , i use a dail up connection , what should i use instead of "xyz.net" and "abc.net"
import java.util.*;
import javax.mail.*;
import javax.mail.internet.*;
public class Simple
public static void main(String args[])
String host ="xyz.net";
String to="[email protected]";
String from="abc.net";
String subject="hjgf";
String messageText="hello";
boolean sessionDebug=false;
Properties props=System.getProperties();
props.put("mail.host",host);
props.put("mail.tranport.protocol","smtp");
Session session=Session.getDefaultInstance(props,null);
session.setDebug(sessionDebug);
try
     Message msg=new MimeMessage(session);
InternetAddress[] address={new InternetAddress(to)};
msg.setRecipients(Message.RecipientType.to,address);
msg.setSubject(subject);
msg.setSentDate(new Date());
msg.setText(messageText);
Transport.send(msg);
catch(MessagingException mex)
mex.printStackTrace();
}}}

If you are using gmail the server name normally be smtp.gmail.com and also you need to authenticate before sending the mail

Similar Messages

  • Lost Mail Program

    I accidentally moved the "Mail" icon from the desktop in the basket with photo icons and deleted in secured system afterwards. I realized before finishing the complet delete and stopped the process. There is still an Icon Mail in the control panel, but it's not opening with the message "architecture not supported". Is there any way to save the Mail program? otherwise it's bad luck!

    Hi Marimoo,
    Welcome to the Forums!
    Just to clarify - did you remove the Mail icon from the [Dock|http://support.apple.com/kb/HT2474] to the trash? if so it is just a simple matter of dragging the Mail icon from your Applications folder back to the dock.

  • My Apple Mail program isn't working properly

    My Mail program suddenly won't get mail.  I clicked on provide mail feedback and when it showed Accounts it said there were 5.  I only have three.
    The dropdown menu asking what system I use didn't list mine: 10.5.8

    Never mind - I actually found out that this is by design. I don't understand WHY it's by design but it is. (remember on OS9 it used to be just a simple click?)
    http://macosg.com/group/viewtopic.php?t=11567
    http://www.rogueamoeba.com/freebies/
    Rogue Amoeba actually made an app called LineIn that fixed my problem 100%.

  • PO Output: Medim 7 (Simple Mail)

    Hi all,
    Has anyone come across with PO output with medium 7 (Simple Mail)?
    Any idea of how to configure it in the system?
    Thanks.
    Tom

    Hi Tom,
    Basically there are two mail types: Internet mail (external mail) and
    SAPOffice mail.
    Mail is sent via the output determination in both cases.
    If you use the external mail, the message for the purchasing document is
    converted into a corresponding text file which is sent to the vendor via
    the Internet.
    SAPOffice mail is sent only within the R/3 System and has mainly the
    function of providing information.
    In particular, it is not possible to attach a message (form) for a
    purchasing document to a SAPOffice mail.
    When using external mail, the following basic settings are required:
    1.  You must maintain an e-mail address in the address in the vendor
        master.
    2.  The same applies to your own user master. You also have to specify
        an e-mail address there in order to identify the sender.
        o  Note that it is not possible to change the e-mail address of the
           vendor via the SAP purchase order transaction (ME21N, ME22N, and
           so on).
        o  You can only make a permanent change using the vendor master
           transactions XK02 or MK02.
         o  You can use a temporary email address in Transaction ME21N.
    3.  For the output type for default values, a communication strategy
         needs to be maintained in the Customizing that supports the e-mail.
         You can find the definition of the communication strategy in the
         Customizing via the following path: (SPRO -> IMG -> SAP Web
         Application Server -> Basic Services -> Message Control -> Define
         Communication Strategy). As a default, communication strategy CS01
         is delivered. This already contains the necessary entry for the
         external communication. Bear in mind that without a suitable
         communication strategy it is not possible to communicate with a
         partner via Medium 5 (external sending).
    4.  Use the standard SAP environment (program 'SAPFM06P', FORM routine
         'ENTRY_NEU' and form 'MEDRUCK') as the processing routines.
    5.  In the condition records for the output type (for example,
         Transaction MN04), use medium '5' (External send).
    6.  You can use Transaction SCOT to trigger the output manually. The
         prerequisite for a correct sending is that the node is set
         correctly. This is not described here, but it must have already been
         carried out.
    7.  To be able to display, for example, the e-mail in Outlook, enter PDF
         as the format in the node.
    To use the SAPOffice mail, the following basic settings are required:
    1.  For the output type for default values, a communication strategy
        needs to be maintained in the Customizing that supports the e-mail.
        You can branch to the maintenance of the communication strategy via
        the input help.
    2.  Use the SAP standard environment (program "RSNASTSO" and FORM
        routine "SAPOFFICE_AUFRUF") as the processing routines.
    3.  In the condition records for the output type (for example,
        Transaction MN04), use medium '7' (SAPOffice) and also partner role
        'MP' (mail partner).
    - Sanjeev

  • Simple mail functionality

    Hi,
    I am testing the simple mail functionality in transaction VA01.
    In customizing (output determination – processing routines) for simple mail is being used a program and a smartform. It was not me who developed them.
    The problem is that when I try to test this through VA01 (I choose simple mail, etc), I get a dump saying: ‘Invalid commit work in an update function module. Termination occurred in the ABAP program ‘SAPLSOI1’ – in “SO_DOCUMENT_SEND_API1”. The main program was “RSM13000’’.
    My problem now is how can I try to debug this when I am in transaction VA02? I am not able to execute the program I have in customizing…
    How can I found more information about this?
    Thanks a lot

    Weird..
    I am working with SAP ECC 6.0 - release 700
    In version history no one has modified the program...
    function so_document_send_api1.
    ""Lokale Schnittstelle:
    *"  IMPORTING
    *"     VALUE(DOCUMENT_DATA) LIKE  SODOCCHGI1 STRUCTURE  SODOCCHGI1
    *"     VALUE(PUT_IN_OUTBOX) LIKE  SONV-FLAG DEFAULT SPACE
    *"     VALUE(SENDER_ADDRESS) LIKE  SOEXTRECI1-RECEIVER DEFAULT SY-UNAME
    *"     VALUE(SENDER_ADDRESS_TYPE) LIKE  SOEXTRECI1-ADR_TYP DEFAULT 'B'
    *"     VALUE(COMMIT_WORK) LIKE  SONV-FLAG DEFAULT SPACE
    *"  EXPORTING
    *"     VALUE(SENT_TO_ALL) LIKE  SONV-FLAG
    *"     VALUE(NEW_OBJECT_ID) LIKE  SOFOLENTI1-OBJECT_ID
    *"     VALUE(SENDER_ID) LIKE  SOUDK STRUCTURE  SOUDK
    *"  TABLES
    *"      PACKING_LIST STRUCTURE  SOPCKLSTI1
    *"      OBJECT_HEADER STRUCTURE  SOLISTI1 OPTIONAL
    *"      CONTENTS_BIN STRUCTURE  SOLISTI1 OPTIONAL
    *"      CONTENTS_TXT STRUCTURE  SOLISTI1 OPTIONAL
    *"      CONTENTS_HEX STRUCTURE  SOLIX OPTIONAL
    *"      OBJECT_PARA STRUCTURE  SOPARAI1 OPTIONAL
    *"      OBJECT_PARB STRUCTURE  SOPARBI1 OPTIONAL
    *"      RECEIVERS STRUCTURE  SOMLRECI1
    *"  EXCEPTIONS
    *"      TOO_MANY_RECEIVERS
    *"      DOCUMENT_NOT_SENT
    *"      DOCUMENT_TYPE_NOT_EXIST
    *"      OPERATION_NO_AUTHORIZATION
    *"      PARAMETER_ERROR
    *"      X_ERROR
    *"      ENQUEUE_ERROR
    data begin of object_hd_change.
            include structure sood1.
    data end of object_hd_change.
    data begin of attach_hd_change.
            include structure sood1.
    data end of attach_hd_change.
    data begin of object_data.
            include structure soodd.
    data end of object_data.
    data begin of objhead occurs 1.
            include structure soli.
    data end of objhead.
    data begin of objcont occurs 100.
            include structure soli.
    data end of objcont.
    data begin of atthead_tab occurs 1.
            include structure soli.
    data end of atthead_tab.
    data begin of attcont_tab occurs 10.
            include structure soli.
    data end of attcont_tab.
    data begin of atthead occurs 1.
            include structure soli.
    data end of atthead.
    data begin of attcont occurs 10.
            include structure soli.
    data end of attcont.
    data begin of new_pack_list occurs 10.
            include structure soxpl.
    data end of new_pack_list.
    data begin of rec_table occurs 10.
            include structure soos1.
    data end of rec_table.
    data begin of object_fl_change.
            include structure sofm1.
    data end of object_fl_change.
    data rcode like sonv-rcode.
    data object_type like sood-objtp.
    data object_id_new like soodk.
    data file_format(3).
    data: originator      like soos1-recextnam,
          originator_type like soos1-recesc.
    data: hex_size like sy-tabix.
    data: old_object like swotobjid,
        * sh070900 5.0A reconvert R30 into OBJ Docs is possible.
          sood_id like soodk.
    data: old_folder_id like soodk,
          old_object_id like soodk,
          old_forwarder like soud-usrnam,
          old_object_data like sood2.
    data hex_mode type sonv-flag value space.
    data dummy_hex type solix_tab.
    **data i.
    **if sy-uname = ''
    while i ne 1.
    endwhile.
    **endif.
    describe table contents_bin lines hex_size.
    if hex_size gt 0.
       call function 'SO_CONVERT_CONTENTS_BIN'
        exporting
          it_contents_bin = contents_bin[]
        importing
          et_contents_bin = contents_bin[].
       data l_new_size     type i.
       data l_line_size    type i.
       data l_new_doc_size type i.
       describe table contents_bin lines l_new_size.
       if l_new_size <> hex_size.
         describe field contents_bin-line length l_line_size in character mode.
         loop at packing_list where transf_bin = on.
           packing_list-body_start = packing_list-body_start * 2 - 1.
           packing_list-body_num = packing_list-body_num * 2.
           l_new_doc_size = packing_list-body_num * l_line_size / 2.
           if packing_list-doc_size <= l_new_doc_size.
             packing_list-doc_size = l_new_doc_size * 2.
           endif.
           modify packing_list.
         endloop.
       endif.
    endif.
    describe table contents_hex lines hex_size.
    if hex_size gt 0.
       refresh contents_bin.
      MOVE CONTENTS_HEX[] TO CONTENTS_BIN[].
       hex_to_cont contents_hex contents_bin.
    endif.
    * transfer document data
      perform transfer_objdat_to_obj using document_data
                                           object_hd_change
                                           object_fl_change.
      perform set_default_object_data using object_hd_change.
    * read object out of table
    * take API1, so no receiver conversion is necessary here
      read table packing_list index 1.   "first object is document
      if sy-subrc ne ok.   "no packing list
        raise parameter_error.
      endif.
      perform read_object_out_of_tables tables object_header
                                               contents_txt
                                               contents_bin
                                               objhead
                                               objcont
                                      using    packing_list
                                               object_data
                                               rcode.
    * parameters    for tracing
      LOOP AT OBJHEAD.
        PERFORM  TRACE(RSSOEXTR) USING 'OBJHEAD'  OBJHEAD-LINE.
      ENDLOOP.
      if rcode ne ok.   "no object found
        raise parameter_error.
      endif.
    * out of object data use only extern content flag and perhaps the size
      move object_data-extct to object_hd_change-extct.
      if object_hd_change-objlen = 0       or
         object_hd_change-objlen is initial.
        move object_data-objlen to object_hd_change-objlen.
      endif.
      perform format_prepare_for_insert in program sapfssoa          "873845
           using packing_list-transf_bin
                 dummy_hex
        changing objhead[]
                 objcont[]
                 packing_list-doc_type
                 object_hd_change-file_ext
                 rcode.
      move packing_list-doc_type to object_type.
    * for old types move size to header
      perform size_to_header tables objhead
                             using  object_type
                                    document_data-doc_size.
    get    now all attachments, decreibed in packing list
      refresh new_pack_list.
      refresh atthead_tab.
      refresh attcont_tab.
      loop at packing_list from 2.
        clear new_pack_list.
        perform read_object_out_of_tables tables object_header
                                                 contents_txt
                                                 contents_bin
                                                 atthead
                                                 attcont
                                        using    packing_list
                                                 object_data
                                                 rcode.
        check rcode = ok.
      * sh240899 46C check for executable mail attachment (MAPI)
        if packing_list-doc_type = 'R3O'.
          read table attcont index 21 into old_object.
          if old_object-objtype = 'SOFM'.
            read table attcont index 22.
            if attcont = 'PROCESS'.
            * it's an attachment created by MAPI because of an executable
            * mail
            * read old mail and fill new one with process parameters
              move: old_object-objkey(17) to old_folder_id,
                    old_object-objkey+17(17) to old_object_id,
                    old_object-objkey+34(12) to old_forwarder.
              call function 'SO_OBJECT_READ'
                   exporting
                        folder_id                  = old_folder_id
                        forwarder                  = old_forwarder
                        object_id                  = old_object_id
                   importing
                        object_hd_display          = old_object_data
                   tables
                        objpara                    = object_para
                        objparb                    = object_parb
                   exceptions
                        folder_not_exist           = 4
                        folder_no_authorization    = 5
                        object_not_exist           = 6
                        object_no_authorization    = 7
                        operation_no_authorization = 8
                        owner_not_exist            = 9
                        parameter_error            = 10
                        others                     = 15.
              if sy-subrc = 0.
                move: old_object_data-vmtyp to object_hd_change-vmtyp,
                      old_object_data-skips to object_hd_change-skips,
                      old_object_data-acnam to object_hd_change-acnam,
                      old_object_data-acmem to object_hd_change-acmem.
              endif.
              continue.
            elseif attcont = 'DISPLAYATTACHMENT'.
            * sh070900 5.0A reconvert R30 into OBJ Docs is possible.
            * get object instance and method into attachment body
              refresh: attcont, atthead.
              move old_object-objkey+17(17) to sood_id.
              perform socx_select(sapfsso0) tables atthead
                                                   attcont
                                                   object_para
                                                   object_parb
                                            using  sood_id
                                                   hex_mode
                                                   rcode.
              move atthead[] to attcont[].
            * fill new packing list parameter
              describe table atthead lines packing_list-head_num.
              describe table attcont lines packing_list-body_num.
              packing_list-doc_size = '255'.
              packing_list-doc_type = obj.
            endif.
          endif.
        endif.
        move-corresponding packing_list to new_pack_list.
        move: packing_list-obj_descr     to new_pack_list-objdes,
              packing_list-obj_name      to new_pack_list-objnam,
              packing_list-doc_size      to new_pack_list-objlen,
              packing_list-obj_langu     to new_pack_list-objla,
              packing_list-mess_type     to new_pack_list-extct,
              packing_list-doc_type      to new_pack_list-objtp,
              packing_list-transf_bin    to new_pack_list-transf_bin."873845
        describe table atthead_tab lines new_pack_list-head_start.
        add 1 to new_pack_list-head_start.
        describe table attcont_tab lines new_pack_list-body_start.
        add 1 to new_pack_list-body_start.
        perform format_prepare_for_insert in program sapfssoa        "873845
             using packing_list-transf_bin
                   dummy_hex
          changing atthead[]
                   attcont[]
                   new_pack_list-objtp
                   new_pack_list-file_ext
                   rcode.
      get new sizes (also for attcont, someone forgot this...)
        describe table atthead lines new_pack_list-head_num.
        describe table attcont lines new_pack_list-body_num.
        loop at atthead.
          clear atthead_tab.
          move atthead to atthead_tab.
          append atthead_tab.
        endloop.
        loop at attcont.
          clear attcont_tab.
          move attcont to attcont_tab.
          append attcont_tab.
        endloop.
        append new_pack_list.
      endloop.
    * transfer receiver data
      perform transfer_rec_to_tab tables receivers
                                         rec_table.
    * sender in right format
      move sender_address to originator.
      perform convert_sndart_esc using sender_address_type
                                       originator_type.
      call function 'SO_OBJECT_SEND'
           exporting
              EXTERN_ADDRESS             = ' '
              FOLDER_ID                  = ' '
              FORWARDER                  = ' '
                object_fl_change           = object_fl_change
                object_hd_change           = object_hd_change
              OBJECT_ID                  = ' '
                object_type                = object_type
                outbox_flag                = put_in_outbox
                originator                 = originator
                originator_type            = originator_type
              OWNER                      = ' '
              STORE_FLAG                 = ' '
           importing
                object_id_new              = object_id_new
                sent_to_all                = sent_to_all
                originator_id              = sender_id
           tables
                objcont                    = objcont
                objhead                    = objhead
                objpara                    = object_para
                objparb                    = object_parb
                packing_list               = new_pack_list
                att_head                   = atthead_tab
                att_cont                   = attcont_tab
                receivers                  = rec_table
           exceptions
                object_not_sent            = 15
                object_type_not_exist      = 17
                operation_no_authorization = 21
                parameter_error            = 23
                too_much_receivers         = 73
                others                     = 1000.
      case sy-subrc.
        when ok.
          move object_id_new to new_object_id.
        when object_not_sent.
          perform transfer_tab_to_rec tables rec_table
                                             receivers.
          raise document_not_sent.
        when too_much_receivers.
          raise too_many_receivers.
        when object_type_not_exist.
          raise document_type_not_exist.
        when operation_no_authorization.
          raise operation_no_authorization.
        when parameter_error.
          raise parameter_error.
        when others.
          raise x_error.
      endcase.
    MOVE OBJECT_ID TO NEW_OBJECT_ID.
      perform transfer_tab_to_rec tables rec_table
                                         receivers.
    set commit work
      if commit_work = on.
        commit work.
      endif.
    endfunction.

  • Problem with Java Mail Program

    Hi Everyone...
    Please help me to sort out this problem...
    I am getting this Exception while executing the code pasted below...
    javax.mail.AuthenticationFailedException
    at javax.mail.Service.connect(Service.java:306)
    at javax.mail.Service.connect(Service.java:156)
    at javax.mail.Service.connect(Service.java:105)
    at javax.mail.Transport.send0(Transport.java:168)
    at javax.mail.Transport.send(Transport.java:98)
    at JDCSend.main(JDCSend.java:38)
    It's just a simple java program to send an email using JavaMail API
    import java.io.*;
    import java.util.*;
    import javax.mail.*;
    import javax.mail.event.*;
    import javax.mail.internet.*;
    import java.util.Properties;
    public class JDCSend {
           public static void main (String args[]) {
              try{
                  String from = "[email protected]";
                  String to = "[email protected]";
                   String host = "smtp.yahoo.com";
        // Get system properties
                  Properties props = System.getProperties();
                   props.put("mail.smtp.host", host);
                   props.put("mail.smtp.port", 465);
                   props.put("mail.smtp.auth", "true");
                   props.put("mail.smtp.starttls.enable","true");
        // Get session
                  Session session = Session.getDefaultInstance(props, null);
        // Define message
                  MimeMessage message = new MimeMessage(session);
                  message.setFrom(new InternetAddress(from));
                  message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
                  message.setSubject("Hello, JDC");
                  message.setText("Welcome to the JDC");
        // Send message
                  Transport.send(message);
              catch(Exception e){ e.printStackTrace(); }
    }

    You need to be identified by stmp server :
    // Send message with authentication!
    Transport tr = session.getTransport("smtp");
    tr.connect(MailHost, user, pass);
    message.saveChanges(); // don't forget this
    tr.sendMessage(message, message.getAllRecipients());
    tr.close();
    Read JavaMail Faq please!

  • Output thro simple mail concept

    Hi
    My requirement is sending invoice output to customer. I have option of sending thro' external send(5). But i am looking to use simple mail(5) concept. Can i use this. If i can use what is the program i need mentioned in the nace and also can i use smart form.
    i had checked with my programmer, he had stdprogram RSNASTSO and form routine SAPOFFICE_AUFRUF_VX which is used to mail to SAP inbox , he tried to modify this program based on our requirement and add the smartform to it. we got the mail but the information in smartform did not come in the mail i.e program is not accessing the information.
    Please let me know your input.
    Thanks
    sriram

    Hi,
    Try the below code.
    REPORT  z_sd_multi_cust_mail.
    TABLES:nast,kna1,vbak.
    DATA : v_vbeln     LIKE vbak-vbeln,
           v_ucomm     LIKE sy-ucomm,
           v_form_name TYPE rs38l_fnam.
    START-OF-SELECTION.
    *&      Form  entry
          text
         -->RETURN_CODE  text
         -->US_SCREEN    text
    FORM entry USING return_code us_screen.
      CLEAR return_code.
      CLEAR:v_vbeln,v_form_name.
      v_vbeln = nast-objky.
      v_ucomm = 'PRNT'.
      IF v_ucomm  = 'PRNT' ."For Mail sending
        CALL FUNCTION 'Z_QUOTATION_MAIL_SEND'
          EXPORTING
            vbeln = nast-objky.
      ENDIF.
      CLEAR:v_ucomm.
    ENDFORM.                    "entry
    In FM 'Z_QUOTATION_MAIL_SEND'
    FUNCTION Z_QUOTATION_MAIL_SEND.
    ""Local Interface:
    *"  IMPORTING
    *"     REFERENCE(VBELN) TYPE  NAST-OBJKY
    Importing Parameter is
    VBELN     TYPE     NAST-OBJKY
      TABLES:  nast,
               kna1,
               vbak.
      DATA: i_otf       TYPE itcoo OCCURS 0       WITH HEADER LINE,
            i_tline     TYPE TABLE OF tline       WITH HEADER LINE,
            i_receivers TYPE TABLE OF somlreci1   WITH HEADER LINE,
            i_record    LIKE solisti1   OCCURS 0  WITH HEADER LINE,
    *---Objects to send mail.
            i_objpack   LIKE sopcklsti1 OCCURS 0  WITH HEADER LINE,
            i_objtxt    LIKE solisti1   OCCURS 0  WITH HEADER LINE,
            i_objbin    LIKE solisti1   OCCURS 0  WITH HEADER LINE,
            i_reclist   LIKE somlreci1  OCCURS 0  WITH HEADER LINE,
    *---Work Area declarations
            wa_objhead  TYPE soli_tab,
            w_ctrlop    TYPE ssfctrlop,
            w_compop    TYPE ssfcompop,
            w_return    TYPE ssfcrescl,
            wa_doc_chng TYPE sodocchgi1,
            w_data      TYPE sodocchgi1,
            wa_buffer   TYPE string, "To convert from 132 to 255
    *--- Variables declarations
            v_form_name  TYPE rs38l_fnam,
            v_len_in     LIKE sood-objlen,
            v_len_out    LIKE sood-objlen,
            v_len_outn   TYPE i,
            v_lines_txt  TYPE i,
            v_lines_bin  TYPE i,
            v_vbeln      TYPE vbak-vbeln.
      DATA:BEGIN OF i_adr6 OCCURS 0,
           addrnumber LIKE adr6-addrnumber,
           consnumber LIKE adr6-consnumber,
           smtp_addr  LIKE adr6-smtp_addr,
           END OF i_adr6.
      v_vbeln = vbeln.
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname           = 'Z_SD_SSF_QUOTATION'
        IMPORTING
          fm_name            = v_form_name
        EXCEPTIONS
          no_form            = 1
          no_function_module = 2
          OTHERS             = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      w_ctrlop-getotf     = 'X'.
      w_ctrlop-no_dialog  = 'X'.
      w_compop-tdnoprev   = 'X'.
      CALL FUNCTION v_form_name   "'/1BCDWB/SF00000093'
        EXPORTING
          control_parameters = w_ctrlop
          output_options     = w_compop
          user_settings      = 'X'
          p_vbeln            = v_vbeln
        IMPORTING
          job_output_info    = w_return
        EXCEPTIONS
          formatting_error   = 1
          internal_error     = 2
          send_error         = 3
          user_canceled      = 4
          OTHERS             = 5.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      i_otf[] = w_return-otfdata[].
      CALL FUNCTION 'CONVERT_OTF'
        EXPORTING
          format                = 'PDF'
          max_linewidth         = 132
        IMPORTING
          bin_filesize          = v_len_in
        TABLES
          otf                   = i_otf
          lines                 = i_tline
        EXCEPTIONS
          err_max_linewidth     = 1
          err_format            = 2
          err_conv_not_possible = 3
          OTHERS                = 4.
      IF sy-subrc <> 0.
      ENDIF.
      LOOP AT i_tline.
        TRANSLATE i_tline USING '~'.
        CONCATENATE wa_buffer i_tline INTO wa_buffer.
      ENDLOOP.
      TRANSLATE wa_buffer USING '~'.
      DO.
        i_record = wa_buffer.
        APPEND i_record.
        SHIFT wa_buffer LEFT BY 255 PLACES.
        IF wa_buffer IS INITIAL.
          EXIT.
        ENDIF.
      ENDDO.
    *---Attachment
      REFRESH:i_reclist,
              i_objtxt,
              i_objbin,
              i_objpack.
      CLEAR wa_objhead.
      i_objbin[] = i_record[].
    *---Create Message Body Title and Description
      i_objtxt = 'PDF-Attachment Of Quotation!'.
      APPEND i_objtxt.
      DESCRIBE TABLE i_objtxt LINES v_lines_txt.
      READ TABLE i_objtxt INDEX v_lines_txt.
      DATA: v_str1 TYPE char12,
            v_str2 TYPE char50.
      CONCATENATE 'Quotation' '-' v_vbeln INTO v_str2 SEPARATED BY space.
      wa_doc_chng-obj_name   = 'smartform'.
      wa_doc_chng-expiry_dat = sy-datum + 10.
      wa_doc_chng-obj_descr  = v_str2.
      wa_doc_chng-sensitivty = 'F'.
      wa_doc_chng-doc_size   = v_lines_txt * 255.
    *---Main Text
      CLEAR i_objpack-transf_bin.
      i_objpack-head_start = 1.
      i_objpack-head_num   = 0.
      i_objpack-body_start = 1.
      i_objpack-body_num   = v_lines_txt.
    i_objpack-doc_type   = 'RAW'.
      APPEND i_objpack.
    *---Attachment (pdf-Attachment)
      i_objpack-transf_bin = 'X'.
      i_objpack-head_start = 1.
      i_objpack-head_num   = 0.
      i_objpack-body_start = 1.
      DESCRIBE TABLE i_objbin LINES v_lines_bin.
      READ TABLE i_objbin INDEX v_lines_bin.
      i_objpack-doc_size  = v_lines_bin * 255 .
      i_objpack-body_num  = v_lines_bin.
      i_objpack-doc_type  = 'PDF'.
      i_objpack-obj_name  = 'smart'.
      i_objpack-obj_descr = 'Quotation'.
      APPEND i_objpack.
      SELECT SINGLE * FROM vbak WHERE vbeln = v_vbeln.
      SELECT SINGLE * FROM kna1 WHERE kunnr = vbak-kunnr.
    *---Getting the Multiple MAIL ID'S in this Vendor
      SELECT addrnumber
             consnumber
             smtp_addr
             FROM adr6 INTO TABLE i_adr6
             WHERE addrnumber = kna1-adrnr
             AND   flg_nouse  = space.
    *---Adding the Multiple mail id into Receiptant list
      LOOP AT i_adr6.
        i_reclist-receiver = i_adr6-smtp_addr.
        i_reclist-rec_type = 'U'.
        APPEND i_reclist.
        CLEAR: i_reclist,i_adr6.
      ENDLOOP.
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = wa_doc_chng
          put_in_outbox              = 'X'
          commit_work                = 'X'
        TABLES
          packing_list               = i_objpack
          object_header              = wa_objhead
          contents_bin               = i_objbin
          contents_txt               = i_objtxt
          receivers                  = i_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.
    ENDFUNCTION.

  • Is there a way to completely reinstall my mail program?

    I'm having serious problems with my Mail program and am thinking that maybe if I just completely reinstall Mail on my MacBook Pro, that might help. How would I go about this? (And is there a way to do it without using those discs you get when you buy your computer? Because I lost those when our basement flooded during Hurricane Irene!)

    Your problem is more likely because of something in your User, the Mail program is a global item, meaning many users can use the same program.
    You can try a simple fix first.
    Use the Finder > Go to open:
    ~/Library/Preferences
    and drop the
    com.apple.mail.plist
    file into the Trash, reboot the machine and launch Mail, reset your preferences. See if that fixs your issue. (the plist file is automatically recreated)
    To find out if it's really something in your user or the mail program itself, create/log into a another user and use the Mall program there, if issues still occur, it's the Mail program.
    (If it's not in the Mail program, reinstalling it will make no difference.)
    The Mail program is reinstalled from the 10.6 disks as bundled programs, or part of a "OS X overwrite" that replaces your current OS X and bundled programs with the older version on the 10.6 disk, you need to immediately Software update afterwards to get OS X and bundled programs current again.
    To perform the OS X overwrite, hold c boot off the 10.6 installer disk and simply install OS X, then reboot normally and apply Software update to get current. The Mail program itself will be replaced.
    Some third party programs that have kext files and other "hooks" into OS X may not function again after performing the OS X overwrite, you just need to reinstall these programs again from fresh sources and it will replace those hooks/kext files back into OS X.
    Please backup your files to a external storage drive and mainatin two seperate hardware copies of your data off the machine at ALL times.
    https://discussions.apple.com/message/16276201#16276201

  • Using Simple Mail option In VL03n

    In VL03N, in the output, there is a option of Simple Mail ( nast-nacha = 7), wherein we can directly specify the email Id of the receiver of the delivery note.
    Can anybody guide me so as what coding needs to be done,if any,  in the smartfrom print program so as the mail can be sent to the specified email Id.
    Any other pointers to solve this issue are also welcome.
    Useful Replies will be highly appreciated and rewarded
    Thanks in advance
    Krishna

    Hi Krishna,
    I am not aware of smartfomrs. it can be done through scripts by using two function module, one is for converting the output into pdf and another is for send mail.
    Regards,
    Kumar.

  • How To Recover Apple Mail Program

    I deleted my mac mail program (not sure how long ago), however, i'd like to start using it again. I looked through the disks (mac os x install discs 1 & 2) that came with the computer when I had purchased it, and found the 'install software bundle' option on disc one, except with no 'mail' program. What can I do and how can I go about reinstalling the mail program?

    How to Use Pacifist to Replace Deleted OS X Applications
    Insert the OS X Installer DVD into the optical drive. Use a simple utility like TinkerTool to toggle invisibility so you can see invisible items. Alternatively, open the Terminal application in your Utilities folder and at the prompt enter the following:
    defaults write com.apple.finder AppleShowAllFiles Yes
    Press RETURN.
    To turn off the display of invisible files repeat the above command substituting No for Yes.
    The install packages are located in the /System/Installation/ folder on the DVD.
    Download the shareware utility Pacifist from VersionTracker or MacUpdate. Use it to extract a fresh copy of the missing item(s) from the file archives on your OS X installation DVD. The file archives are in the /System/Installations/ folder (use Go to Folder option in the Go menu of the Finder.)
    Here are Four Basic ways to use Pacifist (courtesy of George Orville.)
    A. Drag a .pkg icon onto the Pacifist window .....proceed to step 7.
    B. Click on “Open Package ....” and navigate to package desired and click “Open” in the open/save window.....proceed to step 7.
    C. Insert Mac OS X installer CD and when it mounts, navigate to .... Menu->Go->Go to Folder.
    In the path field enter or paste ....
    /Volumes/disc name/System/Installation/Packages (where disc name is the name of the CD/DVD that you inserted.
    • Click on the "Go" button .....
    • Drag a .pkg to Pacifist..... proceed to step 7.
    The package you'll need will have to be discovered by trial and error, but for most applications you should start with the Essentials.pkg and/or Additional Essentials.pkg.
    D. Insert your Mac OS X install disk 1 .... and open Pacifist.
    1. In Pacifist, select "Open Mac OS X Install Packages" ... dialog may appear asking for disk 2, then disk 3 and finally disk 1 again.... {if DVD is not used)...If “Stop Loading” is selected...the procedure will stop!!!
    2a. When loading is complete, a new window appears, click the triangle to display contents of each package...Select item and proceed to step 7.
    2b. or click the “Find” icon in the Pacifist window and type the name of the software you need.
    3. In the list that comes back, click the top most entry for the item that you want. ..... that is the one for the English language.
    4. On the top of the Pacifist window, click “verify” .... you will probably be prompted for your password.
    5. Enter checks for.... “verify permissions” and “verify file contents.” and click “verify” ....enter password when prompted.... you will get back output which may look like this:
    20 files were scanned.
    20 of 20 files were present on the hard disk.
    0 of 20 files had file permissions that did not match those specified in the package.
    0 of 20 files had checksums that did not match those specified in the package.
    6. Click “close”. Go to step 7.
    Extract or Install........
    7. In the Toolbar (upper left), you now have the option to extract or install. Click a file in the lower list and those two icons will be enabled.
    8. If “Extract to...” is selected.... navigate to the location where the file will be placed, select “choose”, select “extract” in new dialog that appears,authenicate , if prompted, click “OK”.
    9. In the next dialog, click “Extract”.
    10. If “Install” is selected... dialog will appear with the location/path of the installed software. Click “Install”
    11. Type in your password, click “OK”
    • Pacifist will begin to extract files.
    12. In steps 8/10ß.... you also have the choice to “cancel”
    Notes.....
    • Pacifist may find that a file it is installing already exists on the hard disk. Pacifist will present you with an alert panel....
    Stop
    Leave original alone
    Update ..... Default selection
    Replace .... Replace option should only be used on full install packages
    Of course you could take the other poster's suggestion but I think this way is quicker and doesn't require a reinstallation of OS X which is really unnecessary.

  • Outgoing .Mac mail from Mail program

    When I set up my .mac mail account on the Mail program, I can receive pick up mail from .mac but can't send mail. I get a can't locate server error message.
    I'm not much of a geek so simple descriptions &/or walk-thrus are greatly appreciated.
    Thanks

    No error message is provided?
    Who is your ISP used for connecting to the internet?
    Most, if not all ISPs now block the use of SMTP servers outside of their network on Port 25. Some ISPs allow the use of an authenticated SMTP server only that is outside of their network on Port 25 (such as the .Mac SMTP server) but some block it use regardless.
    Something to try.
    Go to Mail > Preferences > Accounts and under the Account Information for your .Mac account preferences at the SMTP server selection, select the Server Settings button below.
    At the Server Port field, enter 587 in place of 25 and when finished, select OK to save the changed setting.
    If this doesn't work, select/use your ISP's SMTP server to send mail with your .Mac account which is invisible to all recipients.

  • Mail program keeps re-asking for password for my Yahoo Mail

    So I use the mail program on my macmini (running 10.7.5). After I've setup my yahoo mail (and it has initially accepted the password) it keeps wanting to have me re-enter the password:  Message says:
    "The Yahoo! IMAP server “imap.mail.yahoo.com” rejected the password for user “[email protected]”       Enter your password again or cancel. "
    Then I re-enter the password each time (which is accepted) and then 5 minutes later it prompts me to re-enter all over again!
    Help!  -- And keep it simple, cause I'm a computer neophyte.  Thanks

    Hi John,
    Could you have more than one entry for imap.mail.yahoo.com in Keychain Access?
    Open Keychain Access in Utilities, use Keychain First Aid under the Window Menu item, then either check the Password under that item, change it, or delete it and start over.
    Then See if this helps...
    Mac OS X 10.4 Help, I forgot a password in my Keychain
    http://docs.info.apple.com/article.html?path=Mac/10.4/en/mh1960.html
    Resetting your keychain in Mac OS X...
    If Keychain First Aid finds an issue that it cannot repair, or if you do not know your keychain password, you may need to reset your keychain.
    http://support.apple.com/kb/TS1544

  • Can't access mail program'

    I can't access my mail program on mac book air.
    OSX 10.9.5
    i deleted 1300 emails at one time.  Since then each time I try to enter the mail program, I get kicked out.
    I restarted the computer ,after several attempts to access the email program, but still have the problem.
    I know my start up disk is almost full.
    What can I do now?

    For information about the Other category in the Storage display, see this support article. If the Storage display seems to be inaccurate, try rebuilding the Spotlight index.
    Empty the Trash if you haven't already done so. If you use iPhoto, empty its internal Trash first:
              iPhoto ▹ Empty Trash
    Do the same in other applications, such as Aperture, that have an internal Trash feature. Then restart the computer. That will temporarily free up some space.
    According to Apple documentation, you need at least 9 GB of available space on the startup volume (as shown in the Finder Info window) for normal operation—not the mythical 10%, 15%, or any other percentage. You also need enough space left over to allow for growth of the data. There is little or no performance advantage to having more available space than the minimum Apple recommends. Available storage space that you'll never use is wasted space.
    When Time Machine backs up a portable Mac, some of the free space will be used to make local snapshots, which are backup copies of recently deleted files. The space occupied by local snapshots is reported as available by the Finder, and should be considered as such. In the Storage display of System Information, local snapshots are shown as  Backups. The snapshots are automatically deleted when they expire or when free space falls below a certain level. You ordinarily don't need to, and should not, delete local snapshots yourself. If you followed bad advice to disable local snapshots by running a shell command, you may have ended up with a lot of data in the Other category. Ask for instructions in that case.
    See this support article for some simple ways to free up storage space.
    You can more effectively use a tool such as OmniDiskSweeper (ODS) or GrandPerspective (GP) to explore the volume and find out what's taking up the space. You can also delete files with it, but don't do that unless you're sure that you know what you're deleting and that all data is safely backed up. That means you have multiple backups, not just one. Note that ODS only works with OS X 10.8 or later. If you're running an older OS version, use GP.
    Deleting files inside a photo or iTunes library will corrupt the library. Changes to such a library must be made from within the application that created it. The same goes for Mail files.
    Proceed further only if the problem isn't solved by the above steps.
    ODS or GP can't see the whole filesystem when you run it just by double-clicking; it only sees files that you have permission to read. To see everything, you have to run it as root.
    Back up all data now.
    If you have more than one user account, make sure you're logged in as an administrator. The administrator account is the one that was created automatically when you first set up the computer.
    Install the app you downloaded in the Applications folder as usual. Quit it if it's running.
    Triple-click anywhere in the corresponding line of text below on this page to select it, then copy the selected text to the Clipboard by pressing the key combination command-C:
    sudo /Applications/OmniDiskSweeper.app/Contents/MacOS/OmniDiskSweeper
    sudo /Applications/GrandPerspective.app/Contents/MacOS/GrandPerspective
    Launch the built-in Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad and start typing the name.
    Paste into the Terminal window by pressing command-V. You'll be prompted for your login password, which won't be displayed when you type it. Type carefully and then press return. You may get a one-time warning to be careful. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator. Ignore any other messages that appear in the Terminal window.
    The application window will open, eventually showing all files in all folders, sorted by size. It may take a few minutes for the app to finish scanning.
    I don't recommend that you make a habit of doing this. Don't delete anything as root. If something needs to be deleted, make sure you know what it is and how it got there, and then delete it by other, safer, means. When in doubt, leave it alone or ask for guidance.
    When you're done with the app, quit it and also quit Terminal.

  • Mail program giving me fits

    submitted this a week ago.  received a reply that seemed to indicate I should submit it here.  Just got a new Mac Book Pro with Mt Lion.  Had it a week.  Mail program ok at first. Nowthe  rainbow ball spins for a couple of minutes before it does anything. MobilMe keeps searching. I tried to shut it down but it won't do it, says the incoming server can't be blank, but it has a gray mail.example.com in there that won't allow me to do anything.  I've sent a couple of emails to mail feedback. I have to force quit to get it to stop.  I just force quit the mail program and am using my old lap top in the mornings to answer the bulk of my email.  But boy! Trying to use Yahoo mail, I really appreciate Mac Mail...IMail? whatever they call it, and want it back!
    Can I trash this one and download a new mail program? thanks
    MacBook Pro, Mac OS X (10.7.4)

    Pamela Powers wrote:
    submitted this a week ago.  received a reply that seemed to indicate I should submit it here.  Just got a new Mac Book Pro with Mt Lion.  Had it a week.  Mail program ok at first. Nowthe  rainbow ball spins for a couple of minutes before it does anything. MobilMe keeps searching. I tried to shut it down but it won't do it, says the incoming server can't be blank, but it has a gray mail.example.com in there that won't allow me to do anything.  I've sent a couple of emails to mail feedback. I have to force quit to get it to stop.  I just force quit the mail program and am using my old lap top in the mornings to answer the bulk of my email.  But boy! Trying to use Yahoo mail, I really appreciate Mac Mail...IMail? whatever they call it, and want it back!
    Can I trash this one and download a new mail program? thanks
    MacBook Pro, Mac OS X (10.7.4)
    After a year of advising MobileMe account holders that this service would be replaced by the free iCloud services, Apple has now shutdown MobileMe. That is most likely the reason for your spinning beach ball while attempting to contact the MobileMe mail server, now replaced by a deliberately dysfunctional server address.
    Let's operate on the assumption that your name at me.com email messages remain preserved on Apple servers. This was true prior to MobileMe shutdown, as my transition to iCloud was quite simple. Set up iCloud email using your previous name at me.com address. Start with System Preferences > Mail, Contacts, & Calendars. Select iCloud and follow the steps. Once done, there is a separate iCloud preference pane to enable the services you want to share with another Mac, iPhone, or iPad, also configured with iCloud.
    Here is also the iCloud Setup page.
    Message was edited by: VikingOSX

  • Using iPad mail program I have a draft of an email. I attempted to "cancel" and "delete draft" but it is still on my screen even after shutting down and restarting. How do I exit so that I can use other mail functions?

    Using iPad mail program I have a draft of an email. I have attempted to "cancel" this and "delete draft" but the email stays on my screen. How can I exit this so that I can use other email functions?

    Try closing the Mail app completely and see if it works properly when you re-open the app : from the home screen (i.e. not with the Mail app 'open' on-screen) double-click the home button to bring up the taskbar, then press and hold any of the apps on the taskbar for a couple of seconds or so until they start shaking, then press the '-' in the top left of the Mail app to close it, and touch any part of the screen above the taskbar so as to stop the shaking and close the taskbar.
    If that doesn't work also do a reset : press and hold both the sleep and home buttons for about 10 to 15 seconds (ignore the red slider), after which the Apple logo should appear - you won't lose any content, it's the iPad equivalent of a reboot.

Maybe you are looking for

  • How to Configure Apache Web Server  with Tomcat web container in Linux

    Hi all, I am working on Tomcat web server 5.0.19 on Linux AS 3.0., ( my Control Server) I need map my tomcat to Apache Web Server (httpd) in another system (web server). I dont have jk2_ or jk_mod .so files to use in my tomcat/conf directory to make

  • How extract properties from document saved in blob.

    I need extract all document properties from document (any file type) saved in blob. I've tried three ways... - I've tried using relational ORDDoc.getProperties() by example. But this method returned exception ORDSYS.ORDDOCEXCEPTIONS.DOC_PLUGIN_EXCEPT

  • RealPlayer best to download and save online videos

    I want to download a video clip from the BBC news website (archive, not iPlayer). Is RealPlayer the best, and if so, which version : SP for Mac, Downloader, Converter, Download Agent. All are talked about eg in CNET Editors' review. Very confusing !

  • Lost all faith with BT

    Since November last year we have been suffering issues with our Home Hub which is home hub 2.0 . The wired connections were fine but every so often the wireless connections would disconnect for no reason for every wireless device in the house. We dow

  • Garageband fails to recognize digital audio in connected for recording

    I just bought a new mac mini and when I connect it to my digital piano via the digital (optical) audio in jack, neither Leopard 10.5.1 nor Garageband recognizes that there is a device connected to the audio in port. The digital piano does self-power