Programmaticaly attachement with outlook using java

Hi All,
I used this code                   Runtime.getRuntime().exec(
               new String[] {"rundll32", "url.dll,FileProtocolHandler",
               "mailto:" + "&subject=" + "testmail" + "&attachment="+"\"" + "C:\\test.txt" + "\""}, null
Once execute, it will open outlook express along with subject, but without attachment.
I want to send the attachment programmatically using java..
If anybody come across this issues, share your ideas...
Edited by: SARAV_RS on Dec 28, 2008 11:09 PM

First thing, it's not only for Outlook or windows. I need to check which email application is being using
like outlook,Thunderbird,.
The file is attached programmatic to the corresponding mail application. Those files are
getting from server side (databases).
In jsp,
<a href="mailto:?subject=Pictures from PhotoAlbum&cc= &body=This is the body text&attachment="c:\test.txt'">Email</a><br>{code}
mailto function works only in client side as of my knowledge. We can't use attachment.
Give me any suggestions.
Edited by: SARAV_RS on Dec 29, 2008 3:21 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • XI Mail Adapter: sending emails with attachment with help of java mapping

    Hi ,
    On trying out the scenerio mentioned in the blog, using the java mapping provided
    "XI Mail Adapter: An approach for sending emails with attachment with help of Java mapping
    The scenerio works just fine.
    But the payload as the content of the attachment is not getting generated in proper XML format.
    I suppose it's because of the replace special characters code part..
    Can anyone help me state the modification required in the code.
    Thanks!
    Regards,
    Faria Mithani

    It might be a codepage issue. Is your original payload UTF-8?

  • How to include Logs/log4j in SOA with out using java embedding activity

    Hi,
    I have a requirement where I need to log the values of a particular variable and need to store it in a new log file. Is there any way to log the details with out using java embedding activity.
    Thanks,

    You can try this.
    http://veejai24.blogspot.co.uk/2008/04/simple-way-to-implement-log4j-in-your.html
    Thanks,
    Vijay

  • Merge LiveCycle Form with XML using JAVA

    Hello.
    I am trying to find out how to merge non-interactive form with XML (using JAVA) so the users can see the final output form with the data filled in.
    What are my choices..?
    So far, I have created the interactive forms as template using LiveCycle 8 and wrote ASP.NET code to extract data and store it in SQL database when the user fill out and submit the form.
    It works great but another agency wants to access the form as well.
    They told us that they will create the XML themselves from the database, so they just need to combine the form with XML to display it (non-interactive form).
    They want to use JAVA but I am not sure how to do that...
    Any suggestion?

    Assuming that you start with XML in an org.w3c.dom.Document that stores the XML data. Before you can merge it into a form, you have to convert it to a com.adobe.idp.Document object. TO convert a org.w3c.dom.Document to a com.adobe.idp.Document object -- use the following Java code:
    private Document convertDataSource(org.w3c.dom.Document myDOM)
    byte[] mybytes = null;
    try
    //Create a Java Transformer object
    TransformerFactory transFact = TransformerFactory.newInstance();
    Transformer transForm = transFact.newTransformer();
    //Create a Java ByteArrayOutputStream object
    ByteArrayOutputStream myOutStream = new ByteArrayOutputStream();
    //Create a Java Source object
    javax.xml.transform.dom.DOMSource myInput = new DOMSource(myDOM);
    //Create a Java Result object
    javax.xml.transform.stream.StreamResult myOutput = new StreamResult(myOutStream);
    //Populate the Java ByteArrayOutputStream object
    transForm.transform(myInput,myOutput);
    // Get the size of the ByteArrayOutputStream buffer
    int myByteSize = myOutStream.size();
    //Allocate myByteSize to the byte array
    mybytes = new byte[myByteSize];
    //Copy the content to the byte array
    mybytes = myOutStream.toByteArray();
    catch (Exception e) {
    System.out.println("The following exception occurred: "+e.getMessage());
    //Create a com.adobe.idp.Document object and copy the
    //contents of the byte array
    Document myDocument = new Document(mybytes);
    return myDocument;
    THen you can merge myDocument into the Form using renderPDFFOrm:
    FormsResult formOut = formsClient.renderPDFForm(
    formName, //formQuery
    myDocument, //inDataDoc
    pdfFormRenderSpec, //PDFFormRenderSpec
    uriValues, //urlSpec
    fileAttachments //attachments
    Hope this helps!

  • Cannot compose or reply email with outlook using Safari

    cannot compose or reply email with outlook using Safari

    Thanks Allstar! I have been trying for days to figure this out

  • How to extract email with attachments from outlook using java

    anybody please suggest a solution to the above problem. the program needs to store the attachments from the mails of outlook automatically into the hard disk

    anybody please suggest a solution to the above
    problem. the program needs to store the attachments
    from the mails of outlook automatically into the hard
    diskBest done by not using Java but anything from C++ to VB and reading the Outlook API.

  • BPM 11g integration with UCM11g using Java Enbedded acitivity

    Hi Friends,
    Can anyone throw some idea how to integration with BPM11g and UCM11g
    We need to have a java code using Java Enbedded acitivity.
    1) How to Connect to UCM 11g using java code any sample Java Embedded Code( we are connecting through RIDC)
    2) How to Fetch the document from UCM using RIDC.
    3) How to Close the Connection.
    Hi friends,
    My requirement was Using BPEL JAva Embedded Acitivity need to connect UCM by RIDC. Got SCAC exception. I could solve this today 3/12/2012... refer below link
    Re: SCAC-50012 Got this exception when using BPEL Java Embedded Activity
    But I have the actual thing.. as per my post..
    Now I need to fetch the doc i.e.,
    In UCM we have pdf documents i need to Download that document and show it in ADF UI using Java Embedded Activity.
    Ie., Using Java Code I need to Download and Decode the PDF file using Java Embedded Activity after Connection with UCM. Save as a file in Local Machine then I need to Encode ads PDF and Show it to ADF UI.
    Please experts its Quite Urgent!!
    ThankQ!!
    Regards,
    Pavan
    Edited by: BPM Fresher on Dec 3, 2012 8:12 PM

    Hi experts...
    Any solution for this.. Can any one help me on this...
    Regards,
    Pavan

  • To fetch data from MS Outlook using JAVA

    Hi,
    I want to know about any api that helps in fetching MS Outlook data using JAVA code. Any help will be appreciated.
    Thanks
    Rohit

    Hi,
    I have to write data to an Excel sheet through servlet. But I'll also look in to resding data from MS Excel. will tell you if I am able to do that.
    Akhilesh Pathodia

  • Read Excel with macros using Java POI

    Hi,
    I'm very desperate... I have to do following things: read Excel file with macros. I can read xls without macros, but i haven't ideas what to do, so correctly read records with macros in xls.
    I use following method to listen for incoming records and handles them as required.
    public void processRecord(Record record)
    switch (record.getSid())
    // the BOFRecord can represent either the beginning of a sheet or the workbook
    case BOFRecord.sid:
    BOFRecord bof = (BOFRecord) record;
    if (bof.getType() == bof.TYPE_WORKBOOK)
    System.out.println("Encountered workbook");
    // assigned to the class level member
    } else if (bof.getType() == bof.TYPE_WORKSHEET)
    System.out.println("Encountered sheet reference");
    break;
    case BoundSheetRecord.sid:
    BoundSheetRecord bsr = (BoundSheetRecord) record;
    System.out.println("New sheet named: " + bsr.getSheetname());
    break;
    case RowRecord.sid:
    RowRecord rowrec = (RowRecord) record;
    System.out.println("Row found, first column at "
    + rowrec.getFirstCol() + " last column at " + rowrec.getLastCol());
    break;
    case NumberRecord.sid:
    NumberRecord numrec = (NumberRecord) record;
    System.out.println("Cell found with value " + numrec.getValue()
    + " at row " + numrec.getRow() + " and column " + numrec.getColumn());
    break;
    // SSTRecords store a array of unique strings used in Excel.
    case SSTRecord.sid:
    sstrec = (SSTRecord) record;
    for (int k = 0; k < sstrec.getNumUniqueStrings(); k++)
    System.out.println("String table value " + k + " = " + sstrec.getString(k));
    break;
    case LabelSSTRecord.sid:
    LabelSSTRecord lrec = (LabelSSTRecord) record;
    System.out.println("String cell found with value "
    + sstrec.getString(lrec.getSSTIndex()));
    break;
    case FormulaRecord.sid:
    FormulaRecord fre = (FormulaRecord) record;
    System.out.println("Formula: "+ fre.getValue());
    break;
    I don't know, how check, that incoming record is joined with macro and I don't know how handle it.
    Is there possible to create Excel file with macros using POI?
    Please help me...
    Margaret

    I want to read the contents of an MS Excel file from
    java, is it possible using JavaBeans-ActiveX bridge or
    by any other java technologies, if possible, how ?Bridge2Java from IBM Alphaworks will do the trick for you.
    You can get it from here:
    http://www.alphaworks.ibm.com/aw.nsf/techs/bridge2java
    Using it, you can do things like the following (taken and abbreviated from the samples provided with the package):
    import Excel.*;
    public class QuickExcel
        public static void main(java.lang.String[] args) {
            Application app;
            Workbooks wbs;
            Workbook wb;
            Worksheet sheet;
            Range rangeA1, rangeA2;
            try
                com.ibm.bridge2java.OleEnvironment.Initialize();
                app = new Application(); // Excel.Application !!! :-)
                app.set_Visible(true);
                wbs = app.get_Workbooks();
                wb = wbs.Add();
                sheet = new Worksheet(wb.get_ActiveSheet());
                rangeA1 = sheet.get_Range("A1");
                String out = new String("This is a test");
                rangeA1.set_Value(out);
                // Wait five seconds
                Thread.sleep(5000);
                // Close the workbook without saving
                wb.Close(new Boolean("false"));
                app.Quit();
            } catch (com.ibm.bridge2java.ComException e)
                System.out.println( "COM Exception:" );
                System.out.println( Long.toHexString((e.getHResult())) );
                System.out.println( e.getMessage() );
            } catch (Exception e)
                System.out.println("message: " + e.getMessage());
            } finally
                app = null;
                com.ibm.bridge2java.OleEnvironment.UnInitialize();
    }

  • How to email a pdf file (attachment with password) using ABAP?

    Hi Colleagues,
    I
    n abap, how do you email a pdf file that contains password?
    (pdf with password, not the whole email).
    A custom program is created. Inside this program, it
    retrieves the spool number and converts it to a pdf file
    (using function module '....abapspool...'). No parameter to put password.
    I was able to do the above. The problem is how to put password on
    the pdf file.
    Once the user receives the email (say from hotmail or outlook) with pdf attachment, clicks on the pdf, it will as ask for an attachment.
    sap version 4.7.
    Questions:
    - how to code in ABAP to include the pdf with password in an email
    received from hotmail or outlook?
    - any function modules or classes that can do the pdf password?
    - do we need to install another technology or add-on application or
    ???? to do it? If yes, do we code in abap?
    - any other ideas?
    Thanks in advance.
    Raymund

    Hi Colleagues,
    I
    n abap, how do you email a pdf file that contains password?
    (pdf with password, not the whole email).
    A custom program is created. Inside this program, it
    retrieves the spool number and converts it to a pdf file
    (using function module '....abapspool...'). No parameter to put password.
    I was able to do the above. The problem is how to put password on
    the pdf file.
    Once the user receives the email (say from hotmail or outlook) with pdf attachment, clicks on the pdf, it will as ask for an attachment.
    sap version 4.7.
    Questions:
    - how to code in ABAP to include the pdf with password in an email
    received from hotmail or outlook?
    - any function modules or classes that can do the pdf password?
    - do we need to install another technology or add-on application or
    ???? to do it? If yes, do we code in abap?
    - any other ideas?
    Thanks in advance.
    Raymund

  • Print As Attachment in Outlook using Reader 8

    We just upgraded to Reader 8.1.2. Now, when we are in Outlook and want to print an email with a .pdf attachment, file association doesn't appear to work. We first get a message box asking us for the appropriate program to open the .pdf. If you click Reader 8, it will open the document in Reader, but will not print. We checked the file associations on the server and all .pdf files are set to open with Reader 8. When we had Reader 7 and went to print an email with an attachment, Reader 7 would open and immediately print the attachment.
    Does anyone know if this is a bug with Reader 8.1.2 or if there is a fix for it?
    Thanks

    The problem?  It's actually pretty simple: Microsoft implemented their mail processing in a way that has greatly assisted folks using Microsoft products and Microsoft platforms, and established an "export" mechanism when communicating via mail in heterogeneous computing environments.  Microsoft tools including Microsoft Exchange Server and their systems running Microsoft Windows are a good and very capable mail environment system, with great scale and very well integrated mail, calendar and related processing, and some exceedingly useful tools including SharePoint that have no real analog with OS X, Unix or Linux systems.   But these tools don't necessarily interoperate entirely nicely in heterogeneous environments; with non-Microsoft tools and platforms.
    The winmail.dat mechanism is a part of the whole Microsoft infrastructure, and particularly when the information is being "exported" out from the Microsoft environment, and into a non-Windows and non-Exchange environment.  The determinate here involves the settings chosen by the various senders.  (Possibly also by the defaults chosen by the administrator of the Exchange Server(s) involved, but I haven't checked that.)
    Here's the Microsoft knowledge base article that describes the specificss of the winmail.dat file. 
    There are tools around to read the TNEF-format winmail.dat files on OS X and other platforms, including TNEF's enough for OS X, and likely various other tools.   Or get your senders to reconfigure their settings for you when they're sending messages to you, as described in the Microsoft KB article.

  • Troubles with timeout using java.nio.channels and non-blocking sockets

    Hello.
    I have a server application that employs java.nio.channels with non-blocking sockets.
    The server waits for connections. The client should connect and be first in sending data.
    Timeouts are significant! If client exceeds the allowed time to send data, the server should break the connection.
    The huge trouble I've discovered that I cannot control the timeout when client connects but remains silent.
    My code looks as follows:
    <pre>
    Selector oSel;
    SocketChannel oSockChan;
    Socket oSock;
    SelectionKey oSelKey;
    Iterator<SelectionKey> oItSelKeys;
    int iCurrState, iMask, iCount;
    iCurrState = INT_SERVER_WORKING;
    iMask = SelectionKey.OP_ACCEPT | SelectionKey.OP_CONNECT | SelectionKey.OP_READ | SelectionKey.OP_WRITE;
    while ( iCurrState == INT_SERVER_WORKING )
    try
    *// retrieving next action*
    iCount = oSel.select();
    if ( iCount > 0 )
    oItSelKeys = oSel.selectedKeys().iterator();
    while ( oItSelKeys.hasNext() )
    oSelKey = oItSelKeys.next();
    oItSelKeys.remove();
    if ( oSelKey.isValid() )
    switch ( oSelKey.readyOps() & iMask ) {
    case SelectionKey.OP_ACCEPT :
    oSockChan = oSSockChan.accept();
    oSockChan.configureBlocking(false);
    oSock = oSockChan.socket();
    oSock.setKeepAlive(true);
    oSockChan.register(oSel,SelectionKey.OP_READ,new MyPacket(oSock.getInetAddress(),oSock.getPort()));
    break;
    case SelectionKey.OP_READ :
    oSelKey.interestOps(0);
    ((MyPacket) oSelKey.attachment()).inRequest(); *// preparing request*
    this.getReader().add(oSelKey); *// sending key to reading thread*
    break;
    case SelectionKey.OP_WRITE :
    oSelKey.interestOps(0);
    ((MyRequest) oSelKey.attachment()).inResponse(); *// preparing response*
    this.getWriter().add(oSelKey); *// sending key to writing thread*
    break;
    case SelectionKey.OP_CONNECT :
    default :
    *// nothing to do*
    catch ( IOException oExcept )
    *// do some actions*
    </pre>
    Timeouts are easily controlled by reading and writing threads (see OP_READ and OP_WRITE ).
    But when a client just connects without consequent data send, the state of this connection remains as OP_ACCEPT. The connection remains open for arbitrarily large time and I cannot control it!
    Please help with idea how can I terminate such connections!

    How can I process the keys that weren't selected at the bottom of the loop? Should I use the method keys() ?Yes. Form a new set from keys() and removeAll(selectedKeys()). Do that before you process selectedKeys().
    And the second moment: as I understood a single key may contain several operations simultaneously? Thus I should use several if's (but not if/else 'cause it's the equivalent of switch ... case ).If there is anything unclear about 'your switch statement is invalid. You need an if/else chain' I fail to see what it is. Try reading it again. And if several ifs were really the equivalent of "switch ... case", there wouldn't be a problem in the first place. They're not, and there is.

  • Work with Outlook through Java WebStart?

    I have two questions:
    1. I want my Java app to be able to change stuff in outlook. So when the user uses my app and then opens outlook, it'll be diff. How do I do this?
    2. Is it possible to do the above through Java WebStart? WebStart makes everything over http (i think) or can I also do sockets/SOAP (which yes I know is http, but a bit diff.)? Does anyone know if i can do this?
    Can anyone give me some sample code of even talking to any Microsoft COM through webstart?

    There is a freebie tool we use called bridge2java that makes this fairly easy. You can integrate WebStart as you would with any Java class.

  • Error with TaskSearchFilter using Java APIs in custom component

    I have created a custom Java component for use in LC Process Mgr.
    Upon invoke of process containing component, component fails with the following message:
    2011-02-28 16:28:31,260 ERROR [com.adobe.workflow.AWS] Cannot coerce object: [email protected]41 of type: com.adobe.idp.taskmanager.dsc.client.query.TaskSearchFilter to type: class com.adobe.idp.taskmanager.dsc.client.query.TaskSearchFilter
    Code is pretty basic:
            ServiceClientFactory myFactory = ServiceClientFactory.createInstance();
            TaskManagerQueryService queryManager = TaskManagerClientFactory.getQueryManager(myFactory);
            TaskSearchFilter filter = new TaskSearchFilter();
            filter.addCondition(TaskSearchingConstants.pSTATUS, Operator.EQUALS, "3");
            List<TaskRow> result = queryManager.taskSearch(filter);
    Error seems to occur with the creation of the List. This code works ok when run as standalone file in either Eclipse or Netbeans but not within the component.
    All necessary JARs are included and are listed in the class-path in component.xml.
    Does anyone have any ideas?
    Thanks,
    David

    Looks like a class loader issue.  Usually this is caused by having the a class (TaskSearchFilte) in your component that on the server.   In other words there are two copies of the TaskSearchFilte class - yours and the one already in LiveCycle - and they are in conflict.
    If that's the case, the solution is simple:
    remove the jar files containing the TaskSearchFilte (and any other LiveCycle clients) from your component's jar file.  You may need them in the build path, so your code can compile - but you don't need them in the final component jar.
    remove the references to these jar files from the component.xml file's class-path entry
    add an import-packages section to your component.xml file.  This will not reference the jar files, but the package names themselves.  For example:
    <import-packages>    
         <package version="1.0">com.adobe.idp.taskmanager.dsc.client.query.TaskSearchFilter</package>
         <!--  add more as needed -->
    </import-packages>

  • PDF not attaching to Outlook using Adobe Reader

    When clicking the Mail icon on the tool bar in adobe reader to attach the PDF to an email, adobe reader freezes and the document does not attach. It does work if Outlook 2013 is closed but if Outlook 2013 is open adobe reader just freezes for a minute with nothing happening. I tried turning off protected mode on startup and disabling all outlook addins. This problem started a couple of weeks ago, I tried a system restore but no joy.
    Any help would be greatly appreciated.
    Thanks

    I found the fix! It was a problem with sendmail.api, I fixed it by doing the following:-
    Repair the SendMail plugin:
    Browse to "C:\Program Files\Adobe\Reader 11.0\Reader\plug_ins" and rename SendMail.API to OLD_ SendMail.API.
    Then from Add/Remove programs run a Reader repair.

Maybe you are looking for

  • Very Urgent! Print Report output to local printer on button click in form

    In Sales Order Form there is a print receipt button. In current situation On Clicking the 'Print Receipt Button' it submits a XML Publisher report(PDF output) to the concurrent manager. Currently to print that report i need to go view--> requests-->

  • Formatting Problem

    I've just started to use jquery to put my photography into a neat slideshow but I'm having trouble as the images keep getting cropped off. On this page: http://ryan-harding.com/photography/travel/beijing.html Notice how on the far right of "Prev" and

  • Video/button issue

    Hello, I have a very simple DVD with one 8-minute video track and all I need is one button - a standard 'PLAY' button. I have set one up as part of the background (so has no shape etc.) which is itself a looping video, I cannot work out how to make t

  • How to open OST files?

    Hi, my Exchange Server not work. I need to open my ost file. Is it possible to do this using the Outlook? Files are larger than, which stores a lot of information.

  • Duke's Bookstore Example (yet again)

    Folks'es, i'm currently ploughing my way through the j2ee tutorial 1.4. now that i come to the interesting parts (JSP et al) i'm stuck with getting the bookstore example to work. i've done everything to compile and packge the bookstore.jar, i've crea