How to extract the smtp response code

Hi,
I am trying to get the server response by SMTPTransport.getLastServerResponse(),
and getting the response as "250 2.0.0 OK 1201842889 c39sm4983397anc.25", in case of success.
This response would differ in case of failure.
Could please guide me as how to extract the response code from the result.
Thanks!!

It's time to read the SMTP spec.
Also, read the javadocs for the com.sun.mail.smtp
package to see how to get an Exception even for
success that includes the detailed response codes.
The smtpsend.java demo program will show you how
to interpret the exception.

Similar Messages

  • Get SMTP response codes?

    Is there any standard way when using JavaMail to retrieve the SMTP response code from a failed send? Specifically, if a message fails to send I want to see if it was a 5xx 5.x.x permanent error (in which case I would not retry) or a 4xx 4.x.x temporary failure (in which case I would wait a bit then try again)?
    I know the SMTP response codes are available in the text of the MessagingException, but parsing that text seems a bit fragile since you're at the mercy of the formatting in that particular implementation.
    Thanks.

    I may be mistaken, but I believe the rules are that the numerical status code MUST be at the very beginning of the response, and everything after that numeric response is optional. So parsing shouldn't be a big deal. Snatch up the first three characters, and that ought to be everything you need.

  • AXIS2 - how to extract the response from OElement

    i implemented web services using the bottom to top method, i succed to
    deploy the webservice (embeded in axis.war) into tomcat.
    i generate also all stuf (skeleton, stub....), i have also a Junit test wich call the stub (this is the client of the webservice)
    when the execution finished, i have an OMElement, i would like to know how to extract the arraylist of Project object fromwithin the OMElement
    here is the code :
    public void testgetProjects() throws java.lang.Exception {          
              ProjectServiceImplStub stub = new ProjectServiceImplStub();
              // the default implementation should point to the right endpoint
              GetProjects getProjects24 = (GetProjects) getTestObject(GetProjects.class);
              getProjects24.setLogin("root");
              getProjects24.setSchema("autoprod");
              GetProjectsResponse projectsResponse = stub.getProjects(getProjects24);
              OMElement element = projectsResponse.get_return();
              //TODO extract list of Project object from element
              assertNotNull(projectsResponse);
         }thank you for your help

    You have to separate columns using comma as shown above.Hmm, no, you don't have to. You can also import into Excel from a fixed field length file.
    Just think about CHAR field which data includes a coma. This would just mess the Excel doc. So in these cases, it's a bit more tricky if you want to use CSV... you have to enclose CHAR data into " or '
    Regards,
    Yoann.

  • How to extract the column width in ALv report if its executed in background

    I am executing an ALV report in background , in front end i am getting data properly, in back end for some columns some of the digits are missing.For example if PO no is of 10 digits it will display only 8 becos column size is like that , how to extract coulmns in back ground.
    I have executed in background and checked the spool and  for some of the columns width is not sufficient to display comeplete data so please suggest how to extract the columns sizes if executed inj background for an ALV

    Hi Deepthi,
    you can try with the above mentioned suggestions ,if its worked its fine ,
    If not use Docking container instead of custom container, For ALV in back ground jobs, its suggest to use docking container instead of custom container , below you can find the declaration for docking container and code to use docking and custom container in your program for fore and back ground.
    or you can use docking container alone for both operations.
    Data : G_DOCK1 TYPE REF TO CL_GUI_DOCKING_CONTAINER,
    IF CCON IS INITIAL. (ccon is container name )
    *Check whether the program is run in batch or foreground
        IF CL_GUI_ALV_GRID=>OFFLINE( ) IS INITIAL.
    *Run in foreground
          CREATE OBJECT CCON
            EXPORTING
              CONTAINER_NAME = 'CON1'.
        CREATE OBJECT GRID1
            EXPORTING
              I_PARENT = parent_1.
    ELSE.
    *Run in background
          CREATE OBJECT GRID1
            EXPORTING
              I_PARENT = G_DOCK1.
        ENDIF.
      ENDIF.
    B&R,
    Saravana.S

  • How to extract the content of a mail message?

    Friends,,,
    How to extract the content of a mail message?
    the message does not contain any attachments or images.
    its just a plain text..
    if i use message.getContent(), in addition of the content it returns headers information also...
    but i need only the content of that message...
    if i write code like this:
    String content = (String) message.getContent();
    it gives cast exception...
    if the message contains only plain text, no multipart, then which method is useful to extract only the content?
    please tell me friends..
    thanks in advannce,
    regards,
    Venkata Naveen

    Message.getContent() does not return headers for a simple text/plain
    message. If you're getting headers, something else is wrong.
    Also, casting the result to String should work.
    Most likely the message really isn't a simple text/plain message.
    Provide more details and we'll help you figure out what you're
    doing wrong.
    Also, please read the msgshow.java demo program included with JavaMail.

  • How to extract the data

    data source is 0FI_AP_4 how to extract the data from R3 to bw

    Hai<b> Anand</b>...
    If you also Create a DataSource in R/3 Extract it Using the Transaction code <b>RSA3</b> and Please Replicate DataSource in BW.....
    Replication is Easy in BW....
    Just Click on Right from the SourceSystem and Click the option " <b>Replicating DataSource</b> "....
    The Datasource will be replicated in BW after Clicked.....
    <i><b>Assign points If It Helps </b></i>
    <u><b>BalajeeKannan</b></u><u></u><i></i>

  • How to extract the actual XML document from soap message?

    My problem is " how to extract the actual XML document from soap message? "
    i just want to extract the attachment i.e. (pure XML document without any soap header or envolope).
    i could be ver thank full if u could solve my problem.
    [email protected]

    Hi,
    This is some skeleton code for extracting an attachment from a SOAPMessage.
    import javax.activation.DataHandler.;
    import javax.xml.soap.*;
    import javax.xml.message.*;
    Iterator allAttachments = message.getAttachments();
    AttachmentPart ap1 = null;
    while(allAttachments.hasNext()){
    ap1 = (AttachmentPart)allAttachments.next();
    //Check that the attachment is correct one. By looking at its mime headers
    //Convert the attachment part into its DOM representation:
    if(ap1.getContentType() == "text/xml"){
    //Use the activation dataHandler class to extract the content, then create a StreamSource from
    //the content.
    DataHandler attachmentContent = ap1.getDataHandler();
    StreamSource attachmentStream = new StreamSource(attachmentContent.getInputStream());
    DOMResult domAttachment = getDOMResult(attachmentStream);
    domAttachment holds an xml representation of the attachment.
    Hope this helps.

  • How to extract the details of the stored procedures in the database?

    Dear all,
    How to extract the details of them?
    Bst Rgds,
    Edward

    Hi Wa-Man Edward Chan,
    Following is the PLSQL Block Which Will Give Package, Procedure, Function Source
    set verify off
    undefine which_object;
    undefine which_line;
    declare
    Shows lines with context of:
    VIEW
    FUNCTION
    PROCEDURE
    TRIGGER
    PACKAGE SPECIFICATION
    PACKAGE BODY
    The script uses to temporary tables ERROR_TABLE_TEMP and ERROR_CLOB_TEMP created with:
    CREATE GLOBAL TEMPORARY TABLE ERROR_TABLE_TEMP(line number, text varchar2(4000));
    CREATE GLOBAL TEMPORARY TABLE ERROR_CLOB_TEMP(TEXT CLOB);
    v_offset number:= 5; -- Controls how many lines before and after the line in focus are to be shown
    v_obj_name varchar2(100);
    v_obj_type varchar2(100);
    v_obj_type_new varchar2(100);
    v_obj_line number;
    v_counter number := 0;
    v_text varchar2(32767);
    v_subtext varchar2(1000);
    v_from number;
    v_len number;
    v_marker varchar2(10);
    v_found number;
    v_line_from number;
    v_line_to number;
    v_long_text clob;
    procedure ins_line (p_text in varchar2) is
    begin
    v_counter := v_counter + 1;
    insert into error_table_temp(line,text)
    values (v_counter,p_text);
    end;
    begin
    delete error_table_temp;
    select ltrim(rtrim(upper('&which_object'))), nvl(to_number('&which_line'),0)
    into v_obj_name, v_obj_line
    from dual;
    begin
    select decode(object_type,'PACKAGE','PACKAGE BODY',object_type)
    into v_obj_type
    from user_objects
    where object_name = v_obj_name
    and nvl(v_obj_line,0) > 0
    and rownum = 1;
    exception when no_data_found then
    ins_line('ERROR: Object/line not found');
    return;
    end;
    ins_line(v_obj_name||' ('||v_obj_type||')');
    if v_obj_type in ('PACKAGE BODY','PACKAGE','FUNCTION','PROCEDURE') then
    v_obj_type_new := v_obj_type;
    ins_line('----------------------- PROGRAM LISTING -------------------------');
    for code in (select trim(text) text, lpad(line,4,' ')||' '||decode(line,v_obj_line,'>>>>> ',' ') marker, type
    from user_source
    where name = v_obj_name
    and line between v_obj_line-v_offset and v_obj_line+v_offset
    order by decode(type,v_obj_type,1,2),line) loop
    if v_obj_type_new != code.type then
    ins_line(null);
    v_obj_type_new := code.type;
    v_counter := -100000; -- In order to show specification before body
    ins_line(v_obj_name||' ('||v_obj_type_new||')');
    ins_line('----------------------- PROGRAM LISTING -------------------------');
    end if;
    ins_line(code.marker||code.text);
    end loop;
    elsif v_obj_type = 'VIEW' then
    select text
    into v_text
    from user_views
    where view_name = v_obj_name;
    v_line_from := v_obj_line-v_offset;
    v_line_to := v_obj_line+v_offset;
    v_obj_line := v_obj_line -1;
    ins_line('------------------------------- PROGRAM LISTING -------------------------------');
    for i in v_line_from..v_line_to loop
    begin
    if i = v_obj_line then
    v_marker := '>>>>> ';
    else
    v_marker := ' ';
    end if;
    if i = 0 then
    v_from := 0;
    v_len := instr(v_text,chr(10));
    else
    v_from := instr(v_text,chr(10),1,i);
    v_len := instr(v_text,chr(10),1,i+1) - v_from;
    end if;
    v_subtext := substr(v_text,v_from+1,v_len-1);
    if v_len > 0 then
    ins_line(lpad(to_char(i+1),4,' ')||' '||v_marker||v_subtext);
    end if;
    exception when others then
    null;
    end;
    end loop;
    elsif v_obj_type = 'TRIGGER' then
    ins_line('----------------------- PROGRAM LISTING -------------------------');
    delete error_clob_temp;
    execute immediate 'insert into error_clob_temp (text) '||
    'select to_lob(trigger_body) '||
    'from user_triggers ' ||
    'where trigger_name = '''||v_obj_name||'''';
    select text
    into v_long_text
    from error_clob_temp;
    v_obj_line := v_obj_line-1;
    v_line_from := v_obj_line-v_offset;
    v_line_to := v_obj_line+v_offset;
    for i in v_line_from..v_line_to loop
    begin
    if i = v_obj_line then
    v_marker := '>>>>> ';
    else
    v_marker := ' ';
    end if;
    if i = 0 then
    v_from := 0;
    v_len := dbms_lob.instr(v_long_text,chr(10));
    else
    v_from := dbms_lob.instr(v_long_text,chr(10),1,i);
    v_len := dbms_lob.instr(v_long_text,chr(10),1,i+1) - v_from;
    end if;
    v_subtext := dbms_lob.substr(v_long_text,v_len-1,v_from+1);
    if v_len > 0 then
    ins_line(lpad(to_char(i+1),4,' ')||' '||v_marker||v_subtext);
    end if;
    exception when others then
    null;
    end;
    end loop;
    end if;
    if v_counter = 0 then
    ins_line('*********** NO CODE FOUND ***********');
    else
    ins_line(null);
    end if;
    exception when others then
    ins_line('*********** ERROR: NOT POSSIBLE TO SHOW THE CODE ***********');
    ins_line(' FEJL: '||sqlerrm);
    end;
    set linesize 4000
    set heading off
    set feedback off
    set verify on
    select text
    from error_table_temp
    order by line;
    set linesize 80
    set heading on
    set feedback on
    Prashant

  • How to Use the JAVA SCRIPT code in .htm page of the component

    Hi .
    In my requirement i have to use Java Script Function in .htm code ..how to use the java script code and functions in .htm???
    thank you
    B.Mani

    Check this document  [Arun's Blog|http://wiki.sdn.sap.com/wiki/display/CRM/CRMWebClientUI-TalkingwithJava+Script]
    Regards
    Kavindra

  • How to extract the historical data from R/3

    hi
    I am extracting data from R/3 through LO Extraction. client asked me to enhance the data source by adding field. i have enhanced the field and wrote exit to populate the data for that field.
    how to extract the historical data into BI for the enhanced field. already delta load is running in BI.
    regards

    Hi Satish,
    As per SAP Standard also the best way is to delete whole data from the cube and then load the data from set up tables as you have enhanced the data source.
    After data source enhancement it is supported to load normally because you don't get any historical data for that field.
    Best way is to take down time from the users, normally we do in weekends/non-business hours.
    Then fill the set-up tables; if the data is of huge volume you can adopt parallel mechanism like:
    1. Load set-up tables by yearly basis as a background job.
    2. Load set-up tables by yearly basis with posting periods from jan 1st to 31st dec of any year basis as a background job.
    This can make your self easier and faster for load of set-up tables. After filling up set-up tables. You can unlock all users as there is no worries of postings.
    Then after you can load all the data into BI first into PSA and then into Cube.
    Regards,
    Ravi Kanth.

  • How to Extract the data from R/3 Genric extractor to BW ?

    How to Extract the data from R/3 Genric extractor to BW ?

    hi,
    step by step procedure for generic extraction delta
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/84bf4d68-0601-0010-13b5-b062adbb3e33
    Refer:
    /people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
    http://help.sap.com/saphelp_nw04/helpdata/en/3f/548c9ec754ee4d90188a4f108e0121/content.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/84bf4d68-0601-0010-13b5-b062adbb3e33
    Generic Extraction via Function Module
    /people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
    Extractions in BI
    https://www.sdn.sap.com/irj/sdn/wiki
    New to Materials Management / Warehouse Management?
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/1b439590-0201-0010-ea8e-cba686f21f06
    Ramesh

  • How to setup the SMTP server in Oracle apps?

    Hi,
    How to setup the SMTP server in Oracle Apps? Is it mandatory to keep the SMTP server on the same host where the Oracle data base is installed? Also can someone help how we can set up the SMTP server on different host (not the Database server) and we can use the same for Workflow notification mailer.
    Thanks,
    Bijoy
    Edited by: user12070886 on Feb 6, 2013 4:26 AM
    Edited by: user12070886 on Feb 6, 2013 4:27 AM

    How to setup the SMTP server in Oracle Apps? Is it mandatory to keep the SMTP server on the same host where the Oracle data base is installed? No, it is not mandatory. Also please note that the mails are sent out from concurrent manager mode. Not from the database node.
    Also can someone help how we can set up the SMTP server on different host (not the Database server) and we can use the same for Workflow notification mailer.
    >
    It depends on the operating system you are using. If you are using *nix then sendmail needs to be configured.
    Thanks

  • How to Extract the Highlight Text in PDF File

    Hi Scripters,
    i want know, how to extract the hightlight text in pdf files for text only format for (*.txt) file extension save.
    regards
    baby

    Hi,
    Okay i'll try do best.
    thanks for your reply.
    Regards
    Baby

  • How to extract the audio of a zip file? if it helps I'm trying to add this album zip to my library

    how to extract the audio of a zip file? if it helps I'm trying to add this album zip to my library

    Let's say you have a zipped audio collection (audio.zip) containing mp3 files. And you are at a Terminal prompt.
    List the files in the zip archive
    unzip -l audio.zip (that is ell)
    Extract all mp3 audio files into a new home directory folder called mymusic
    unzip -d ~/mymusic audio.zip \*.mp3
    Variations of the above will depend the zip contents, and internal structure. If the zipped audio collection was gzipped, or someone used rar on it, then the extraction process will be different.

  • How to extract the senders IP address of an email?

    How to extract the senders IP adress of an email using applescript ??

    Maybe this will help.
    Extract email addresses from email header - Sender (From) - Mail

Maybe you are looking for

  • Can i use an external drive in macbook pro mid 2012?

    replaced my optical drive with new matshita UJ8A8 drive in my macbook pro 13 mid 2012. problem was prior to replacing every type of disc wold be ejected, now when disc goes in new drive makes a sound and then ejects???? any ideas? I have 16 gig of ra

  • ORA-00028 combined with ORA-02063 - preceding line

    Hello, We had undergone an SAP release upgrade form SAP 4.7 to SAP 6.0. From time to time, some of the customer legacy programs, dumps while trying to enter parameters in the Oracle database. They are not crashing every time but latley every night. A

  • Banking Vendor Info not updated from HR Banking infotype

    Hi Gurus, I have an issue  and I can't quite for sure know  how to solve it. My HR team are able to change the banking info of the vendors/employees( employees are also treated as vendors) ....  When we run a report or job  for employee's direct depo

  • Edit Captivate Widget in Flash tutorial

    I'm fairly familiar with Captivate, but just getting started with Flash CS4. Does anyone know of any tutorials or simple explanations about how to edit a Captivate 4 widget in Flash CS4? I'd like to start with editing the Certificate widget.

  • PS CC running extremely slow...  No issues with CS6...

    Same system...  CS6 runs perfectly fine, close it, then load CC, not even workable.  Close CC and reload CS6 and it runs fine... Is CC really that much more hardware dependent?  I feel like the issue is software related and has nothing to do with my