Question about using JavaMail API to read the calendar folder...

Hi,
I've made an application that goes to the mail server, fetches all mails in the calendar folder and tells you the meetings you have in a particular day.
I'm using JavaMail API for this. My problem is that the application is very slow because I'm forced to fetch (one by one!) the contents of every message.
My question is: How can Outlook show so fast the mettings you have? Do they have a specific API that allows them to get the right info by only calling certain methods? Is there something similar in Java?
Thaks for your help!
Note: I use method:
folder.fetch(allMessages, fetchProfile);howerver the fetchProfile class does not allow me to specfy that I want to dowload the contents of the message (you only can specify the content_info); specifying all headears does not help me either.

Clarification:
The VI you have posted will work as following:
1) The task will read 2 analog inputs (ai0, ai3).
2) The acquisition starts, oncece digital signal (trigger) is detected on PFI0
3) The sampling rate will be as specified in "rate" control - it is continuous analog input acquisition, which means that after trigger is received (point 2), the board will start to generate hardware clock with frequency you specify as "rate"
4) with each rising edge of that hardware clock, the measurement is taken, and stored into buffer of driver.
5) DAQmx read will try to read "number of samples per channel" number of samples each time is called - and if there is not enough measurement stored in buffer (step 4), then DAQmx read will wait until DAQ card will measure reaquested number of samples (or timeout occurs before requested number of samples has been acquired)
6) DAQmx read will be then called 1000 times - so totaly you will read 1000 * "number of samples per channel"  number of samples.
You do not have to be worried about speed of the loop. In fact, if you need to read just 1000 samples, with 1kS/s, then you can remove for loop and you can change measurement mode from continuous to finite samples, and specify number of samples to read to be 1000. You will read them all properly. I recomend you to read User Manual for your DAQ device - lets say M Series User Manual.
I hope it is clear now.
regards,
stefo

Similar Messages

  • Question about using a PHP include for the head info...

    Hi,
    I'm currently using PHP includes for my site header and footer info.
    All my js/css files and meta declarations are in the head portion, which is in the header include.
    How would I go about giving each page its own individual TITLE if the modifiable content of my pages is inside the body only? Since we can't specify title inside the body, am I stuck with the same page title for each page on the website?

    Is it true that you header include file has the </head> and <body> tags embedded? It would seem a lot neater - and safer - to use two include files, one for the header and one for the body. That way, the <title> is not in either of them and you can do with it what you will.
    Barry

  • Questions about Using APIs to import Bills and Routings - AND COSTS

    Hi Forum - the following is a back-and-forth with a customer about use of APIs - Inventory developer suggested I post the question here. Note the 2nd question - and thanks for any assistance.
    SR# 7332152.994 ALCOA
    Instructions given to ct:
    Q1 - Can I load the bill header and components at the same time?
    You should be able to load the bill header and components at the same time. Customer loads bill and component data inserting enough "other" data for each so that the bill sequence id will be derived. For the component record, the assembly item, org and alternate_bom_designator values will be used by BMCOIN to derive the bill_sequence_id.
    Example:
    INSERT INTO BOM_BILL_OF_MTLS_INTERFACE
    ORGANIZATION_CODE,
    ITEM_NUMBER,
    ALTERNATE_BOM_DESIGNATOR,
    PROCESS_FLAG,
    TRANSACTION_TYPE
    VALUES
    'M1',
    '&PARENT_ITEM',
    NULL,
    '1',
    'CREATE'
    INSERT INTO BOM_INVENTORY_COMPS_INTERFACE b
    ORGANIZATION_CODE,
    ASSEMBLY_ITEM_NUMBER,
    ALTERNATE_BOM_DESIGNATOR,
    COMPONENT_ITEM_NUMBER,
    OPERATION_SEQ_NUM,
    COMPONENT_QUANTITY,
    EFFECTIVITY_DATE,
    PROCESS_FLAG,
    TRANSACTION_TYPE
    VALUES
    'M1',
    '&PARENT_ITEM',
    NULL,
    '&COMPONENT_ITEM',
    1,
    1,
    trunc(SYSDATE),
    1,
    'CREATE'
    Hi Aruna, some additional information that may be useful:
    We can load/create the bill header and components at the same time using the scripts given (as above)
    Required Data for Creating a Routing : assembly_item_id,
    organization_id, routing_type, transaction_type, process_flag
    And following scripts can be used to load routing header and operations equences.
    INSERT INTO BOM_OP_ROUTINGS_INTERFACE
    (assembly_item_id,
    organization_id,
    routing_type,
    transaction_type,
    process_flag)
    VALUES (2255800,207,1,'Create',1);
    INSERT INTO BOM_OP_SEQUENCES_INTERFACE
    (assembly_item_id,
    organization_id,
    operation_seq_num,
    Department_code,
    effectivity_date,
    transaction_type,
    process_flag,
    operation_description)
    VALUES
    (2255800,207,100,'ASSEMBLY',
    to_date('24-FEB-2009'),'Create',1,
    'Paint Wagon');
    Q2: One more question, can an expense item can be added to the bill and can contribute the cost.
    As there is a confusion of what I asked, below I am rephrasing my question
    By an Expense Inventory Item, I mean an item that is just tracked for quantity only i.e.,Checking the attributes - Inventory Item, Stockable, Transactable under Inventory Tab and not checking the attribute - 'Inventory Asset Value'.
    My question here is, For these Expense Inventory Items, What is the difference between having the 'Costing enabled' attribute turned ON as opposed to having it UNCHECKED
    *Q3 I have tried to load the items and I could only load 1st level of components but could not load second level of bom at the same time.
    While inserting I have inserted plan level too.
    Please let me know if I have to do anything different to load second level.*
    Thanks
    James

    You may want to look at using the more4apps bill of materials wizard, an excel based solution for uploading assemblies and their components.

  • Hi, I have quick question about use of USEBEAN tag in SP2. When I specify a scope of SESSION for the java bean, it does not keep the values that I set for variable in the bean persistent.Thanks,Sonny

     

    Make sure that your bean is implementing the serializable interface and that
    you are accessing the bean from the session with the same name.
    Bryan
    "Sandeep Suri" <[email protected]> wrote in message
    news:[email protected]..
    Hi, I have quick question about use of USEBEAN tag in SP2. When I
    specify a scope of SESSION for the java bean, it does not keep the
    values that I set for variable in the bean persistent.Thanks,Sonny
    Try our New Web Based Forum at http://softwareforum.sun.com
    Includes Access to our Product Knowledge Base!

  • Where Would be the best category to ask a question about using dashboard?

    Where Would be the best category to ask a question about using dashboard?

    However, don't ask it in this topic. Create a new topic for the question with a title describing that you are looking for Dashboard help.

  • I have a question about using multiple ipads in our school.  Each of our teachers have a iPad and AppleTV in their classroom.  The issue is, with our classrooms so close in proximity to one another, is there a way to pair teacher

    I have a question about using multiple ipads in our school.  Each of our teachers have a iPad and AppleTV in their classroom.  The issue is, with our classrooms so close in proximity to one another, is there a way to pair teacher #1 iPad to its AppleTV without effecting/projecting onto the adjacent teachers #2 classroom AppleTV?

    Not as such.
    Give the AppleTV units unique names and also enable Airplay password in settings with unique passwords for each teacher.
    AC

  • Problem Sending mails in a loop using JavaMail API

    Hello All,
    I am sending emails in a loop(one after the other) using JavaMail API,but the problem is, if the first two,three email addresses in the loop are Valid it sends the Email Properly, but if the Fourth or so is Invalid Address it throws an Exception....
    "javax.mail.SendFailedException: Sending failed;"
    nested exception is:
    javax.mail.SendFailedException: Invalid Addresses;
    nested exception is:
    javax.mail.SendFailedException: 450 <[email protected]>:Recipient address rejected: Domain not found......
    So if i want to send hundereds of emails and if one of the Emails inbetween is Invalid the process Stops at that point and i could not send the other emails in the Loop......
    How Could i Trap the exception thrown and handle it in such a way, so that the loops continues ..
    Is there something with the SMTP Server....?
    The code which i am using is as follows....
    <Code>...
    try {
    InitialContext ic = new InitialContext();
    Session session = (Session) ic.lookup(JNDINames.MAIL_SESSION);
    if (Debug.debuggingOn)
    session.setDebug(true);
    // construct the message
    MimeMessage msg = new MimeMessage(session);
    msg.setFrom(new InternetAddress(eMess.getEmailSender()));
    String to = "";
    msg.setRecipients(Message.RecipientType.TO,
    InternetAddress.parse(to, false));
    msg.setRecipients(Message.RecipientType.BCC,
    InternetAddress.parse(eMess.getEmailReceiver(), false));
    msg.setSubject(eMess.getSubject());
    msg.setContent(eMess.getHtmlContents(),"text/plain");
    msg.saveChanges();                
    Transport.send(msg);
    } catch (Exception e) {
    Debug.print("createAndSendMail exception : " + e);
    throw new MailerAppException("Failure while sending mail");
    </Code>....
    Please give me any suggestions regarding it....and guide me accordingly..
    Thanks a million in advance...
    Regards
    Sam

    How about something like the code attached here. Be aware it is lifted and edited out of an app we have here so it may require changing to get it to work. If it don't work - don't come asking for help as this is only a rough example of one way of doing it. RTFM - that's how we worked it out!
    SH
    try {
    Transport.send(msg);
    // If we get to here then the mail went OK so update all the records in the email as sent
    System.out.println("Email sent OK");
    catch (MessagingException mex) {
    System.out.println("Message error");
    Exception ex = mex;
    do {
    if (ex instanceof SendFailedException) {
    if (ex.getMessage().startsWith("Sending failed")) {
    // Ignore this message as we want to know the real reason for failure
    // If we get an Invalid Address error or a Message partially delivered message process the message
    if (ex.getMessage().startsWith("Message partially delivered")
    || ex.getMessage().startsWith("Invalid Addresses")) {
    // This message is of interest as we need to process the actual individual addresses
    System.out.println(ex.getMessage().substring(0, ex.getMessage().indexOf(";")));
    // Now get the addresses from the SendFailedException
    SendFailedException sfex = (SendFailedException) ex;
    Address[] invalid = sfex.getInvalidAddresses();
    if (invalid != null) {
    System.out.println("Invalid Addresse(s) found -");
    if (invalid.length > 0) {
    for (int x = 0; x < invalid.length; x++) {
    System.out.println(invalid[x].toString().trim());
    Address[] validUnsent = sfex.getValidUnsentAddresses();
    if (validUnsent != null) {
    System.out.println("Valid Unsent Addresses found -");
    if (validUnsent.length > 0) {
    for (int x = 0; x < validUnsent.length; x++) {
    System.out.println(validUnsent[x].toString().trim());
    Address[] validSent = sfex.getValidSentAddresses();
    if (validSent != null) {
    System.out.println("Valid Sent Addresses found -");
    if (validSent.length > 0) {
    for (int x = 0; x < validSent.length; x++) {
    System.out.println(validSent[x].toString().trim());
    if (ex instanceof MessagingException)
    ex = ((MessagingException) ex).getNextException();
    else {
    // This is a general catch all and we should assume that no messages went and should stop
    System.out.println(ex.toString());
    throw ex;
    } while (ex != null);

  • Question about use Windows Installer SDK

    Hi,
    I want to Use C# code to read .MSP file and get inside file list. Such as: you can get a hotfix from here
    https://support.microsoft.com/en-us/kb/3000847 and after extract the exe you can get a .MSP file. And 3 DLL files are including in the .MSP file.
    What I want is Use C# code to read the .MSP file and get the 3 DLL file name. Here is how to read it with C++:
    https://msdn.microsoft.com/en-us/library/windows/desktop/aa816375%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396
    But I don't konw about C++, So I'm trying use C# code to call Windows SDK. And I import the Windows SDK code into C# like below:
    [DllImport("msi",
    CharSet = CharSet.Auto)]
    internal
    static
    extern
    uint MsiGetPatchFileList(string
    szProductCode, string szPatchList,
    out
    uint cFiles,
    out
    IntPtr phFileRecords);
    My question is that: How to get the parameter information, such as
    szProductCode. How to read the file information from phFileRecords in C# code?
    Best regards,
    Glen Qu (Fareast\v-zuqu)

    Hi,
    I want to Use C# code to read .MSP file and get inside file list. Such as: you can get a hotfix from here
    https://support.microsoft.com/en-us/kb/3000847 and after extract the exe you can get a .MSP file. And 3 DLL files are including in the .MSP file.
    What I want is Use C# code to read the .MSP file and get the 3 DLL file name. Here is how to read it with C++:
    https://msdn.microsoft.com/en-us/library/windows/desktop/aa816375%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396
    But I don't konw about C++, So I'm trying use C# code to call Windows SDK. And I import the Windows SDK code into C# like below:
    [DllImport("msi",
    CharSet = CharSet.Auto)]
    internal
    static
    extern
    uint MsiGetPatchFileList(string
    szProductCode, string szPatchList,
    out
    uint cFiles,
    out
    IntPtr phFileRecords);
    My question is that: How to get the parameter information, such as
    szProductCode. How to read the file information from phFileRecords in C# code?
    Best regards,
    Glen Qu (Fareast\v-zuqu)
    Hello,
    For MSI APIs, you could refer to
    Installer Function Reference
    It has helped us separate them to multiple parts. Like for getting product code, we could refer to
    Product Query Functions part, like the
    MsiGetProductProperty .
    For getting file information, then refer to File Query Functions
    part.
    Regards,
    Carl
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Retriving unread mails using JavaMail api...

    Hi everyone, I am developing a swing GUI application using Java Netbeans and I want to develop a mail client which retrieves mails using Javamail api. Can anyone suggest me how I can implement the code to retrive the same.

    Did you bother reading anything before posting that question?

  • Java API to read the Encrypted Values from Windows Registry settings

    Is there any Java API to read the Encrypted Values from Windows Registry settings ?
    My Java Application invokes a 3rd party Tool that writes the key/value to windows registry settings under : “HKLM\Software\<3rdparty>\dataValue”.
    This entry is in BINARY and encrypted with 3DES, using crypto API from Microsoft.
    3rd party software to encrypt the data stored in registry it
    either uses C++ code: and uses the call “CryptProtectData” and “CryptUnProtectData” or
    If it is a .NET (C#) it uses the call “Protect” or “UnProtect” from class “ProtectData” of WinCrypt.h from the library “Crypt32.lib.
    Note: The data is encrypted using auto-generated machinekey and there is no public key shared to decrypt the Encrypted data.
    Since the data is encrypted using auto-generated machinekey the same can be decrypted from a .Net / C++ application using CryptUnprotectData or UnProtect() API of WinCrypt.h from the library “Crypt32.lib.
    To know more about Auto-Generated MachineKey in Windows refer the links below
    http://aspnetresources.com/tools/machineKey
    http://msdn.microsoft.com/en-us/library/ms998288.aspx
    I need to find a way in Java to find the equivalent API to decrypt (CryptUnprotectData) and Microsoft will automatically use the correct key.
    But i couldn't find any informato related to Java APIs to enrypt or decrypt data using auto-generated machinekey.
    Is there a way to read the encrypted data from Windows regsitry settings that is encrypted using the Auto-Generated Machine Key ?
    Kindly let me know if Java provides any such API or mechanism for this.

    If the symmetric key is "auto-generated" and is not being stored anywhere on the machine, it implies that the key is being regenerated based on known values on the machine. This is the same principle in generating 3DES keys using PBE (password-based-encryption). I would review the documentation on the C# side, figure out the algorithm or "seed" values being used by the algorithm, and then attempt to use the JCE to derive the 3DES key using PBE; you will need to provide the known values as parameters to the PBE key-generation function in JCE. Once derived, it can be used to decrypt the ciphertext from the Regiistry in exactly the same way as the CAPI/CNG framework.
    An alternate way for Java to use this key, is to write a JNI library that will call the native Windows code to do the decryption; then the Java program does not need to know details about the key.
    That said, there is a risk that if your code can derive the key based on known seeds, then so can an attacker. I don't know what your applicatiion is doing, but if this is anything related to compliance for some data-security regulation like PCI-DSS, then you will fail the audit (for being unable to prove you have adequate controls on the symmetric key) if a knowledgable QSA probes this design.
    Arshad Noor
    StrongAuth, Inc.

  • Getting exceptions while sending mail using javamail api

    Hi to all
    I am developing an application of sending a mail using JavaMail api. My program is below:
    quote:
    import javax.mail.*;
    import javax.mail.internet.*;
    import java.util.*;
    public class sms
    public static void main(String args[])
    try
    String strstrsmtserver="smtp.bol.net.in";
    String strto="[email protected]";
    String strfrom="[email protected]";
    String strsubject="Hello";
    String bodytext="This is my first java mail program";
    sms s=new sms();
    s.send(strstrsmtserver,strto,strfrom,strsubject,bodytext);
    catch(Exception e)
    System.out.println("usage:java sms"+"strstrsmtpserver tosddress fromaddress subjecttext bodyText");
    System.exit(0);
    public void send(String strsmtpserver,String strto,String strfrom ,String strsubject,String bodytext)
    try
    java.security.Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
    Properties p=new Properties(System.getProperties());
    if(strsmtpserver!=null)
    p.put("mail.transport.protocol","smtp");
    p.put("mail.smtp.host","[email protected]");
    p.put("mail.smtp.port","25");
    Session session=Session.getDefaultInstance(p);
    Message msg=new MimeMessage(session);
    Transport trans = session.getTransport("smtp");
    trans.connect("smtp.bol.net.in","[email protected]","1234563757");
    msg.setFrom(new InternetAddress(strfrom));
    msg.setRecipients(Message.RecipientType.TO,InternetAddress.parse(strto,false));
    msg.setSubject(strsubject);
    msg.setText(bodytext);
    msg.setHeader("X-Mailer","mtnlmail");
    msg.setSentDate(new Date());
    Transport.send(msg);
    System.out.println("Message sent OK.");
    catch(Exception ex)
    System.out.println("here is error");
    ex.printStackTrace();
    It compiles fine but showing exceptions at run time.Please help me to remove these exceptions.I am new to this JavaMail and it is my first program of javamail.Please also tell me how to use smtp server.I am using MTNL 's internet connection having smtp.bol.net.in server.
    exceptions are:
    Here is exception
    quote:
    Javax.mail.MessagingException:Could not connect to SMTP host : smtp.bol.net.in, port :25;
    Nested exception is :
    Java.net.ConnectException:Connection refused: connect
    At com.sun.mail.smtp.SMTPTransport.openServer<SMTPTransport.java:1227>
    At com.sun.mail.smtp.SMTPTransport.protocolConnect<SMTPTransport.java:322>
    At javax.mail.Service .connect(Service.java:236>
    At javax.mail.Service.connect<Service.java:137>
    At sms.send<sms.java:77>
    At sms.main<sms.java:24>

    Did you find the JavaMail FAQ?
    You should talk to your ISP to get the details for connecting to your server.
    In this case I suspect your server wants you to make the connection on the
    secure port. The FAQ has examples of how to do this for GMail and Yahoo
    mail, which work similarly. By changing the host name, these same examples
    will likely work for you.

  • Question about using new battery in old Powerbook

    I have a pre-intel Powerbook G4, and the battery is pretty much toast (lasts about 15 minutes now). I have ordered a new battery for it, and I have this question about using it:
    Am I smarter to keep the new strong battery out of the PB most days (as I usually work with it plugged in at home) and just pop it in when I know I will be out surfing on batteries? Or is it just as good living in my laptop 24/7 and only occasionally being called upon to do its job?
    Current bad Battery Information below:
    Battery Installed: Yes
    First low level warning: No
    Full Charge Capacity (mAh): 1144
    Remaining Capacity (mAh): 1115
    Amperage (mA): 0
    Voltage (mV): 12387
    Cycle Count: 281
    thanks folks, Shereen

    Hi, Shereen. Every Powerbook battery wants to be used — drained and then recharged — at least every couple of weeks. If you've always used your Powerbook on AC power nearly all the time, and not followed that pattern of discharging and recharging the battery every week or two, it's possible that your use habits have shortened the lifespan and prematurely diminished the capacity of your old battery. Of course it's also possible that your battery is merely old, as a battery's capacity also diminishes with age regardless of how it's used. You didn't say how old the battery is in years, so this may or may not be an issue. I mention it only because it can be an issue.
    For general information on handling a battery for the longest possible lifespan, see this article. My advice on the basis of that article and long experience reading these forums is that it would be OK to do as you propose, but I doubt that you'd derive any significant benefit from it. You would still want to be sure of putting the new battery through a charge/discharge cycle every week or two, even if you didn't have a reason to use the Powerbook away from home or your desk, because sitting unused outside the computer is just as bad for a battery as sitting unused inside it. And you should never remove the battery from your computer when it's completely or almost completely discharged and let it sit that way any longer than a day or two.
    Message was edited by: eww

  • Question about using Macbook in Vietnam.

    I have a question about using Macbook in Vietnam. I bought my mac here in the US, and I'm going to visit Vietnam, but I'm wondering if I can plug in the power directly into the wall or I have to need any convert power modem for my mac. The only thing I know that Vietnam use 220V so, can anyone help me?

    You may need a plug adaptor, but you don't need a power converter.
    (43828)

  • I have a question about using adobe CS files in CS6 edition

    I am a graphic artist . I have a question about using adobe CS files in CS6 edition. when I am gonna open thse adobe CS created files in CS6 Edition i get a color variation than i made with the CS version.Please give me an idea about this issue as soon as possible.If you need i can upload my problem as a screenshot to clearity

    donrulz,
    Are your Edit>Color Settings the same?
    Are you using spot colours, such as Pantone (there have been some changes in CMYK values with new colour books)?

  • Third Party APIs in Java Language which doesnot use JavaMail APIs

    Hi Pals,
    Is there any third party java mail APIs available which doesnot using Sun JavaMail APIs? The third party would have its own APIs which does not use javax.mail. I have to code in Java Platform so if the APIs are java based its nice and useful to me.....
    Thanks & Regards,
    Prakash

    ksp wrote:
    Hi,
    I am using Javamail APIs to send mails. Sometimes Mcafee blocks the mails and its not allowing javax.mail package. Thats why i would like to go for some other third pary which uses their own APIs......What makes you think a third party API would be less prone to interference by McAfee?
    Edited by: sabre150 on Jun 18, 2009 10:39 AM
    :-)

Maybe you are looking for

  • E-Recruiting-  Questionnaire

    Hi I have two questions on Questionnaires. How to maintain weighting to the questions. How to maintain sub titles and questions under each sub title. The type of scale varies for each sub title. You thoughts are highly appreciated.

  • JSF or struts\JSP?

    Hello; I am creating a portlet. 1) For the portal window, should I use HTML, DHTML, or Swing? 2) If HTML, should I use struts/JSTL/JSP or JSF? 3) What�s easiest for the UI development � IntelliJ/Dreamweaver, BEA�s Workshop, Java Studio Creator, Sun O

  • Audio Cutoff in Premiere Pro

    Having trouble with Adobe Premiere Pro CC 2014. I imported MTS clips from my canon video camera to Premiere, but the audio drops off in the middle and there's no movement in the audio bar on the right. When I dragged the files to the computer, I drag

  • Convert 7.0 driver to 6.1

    Hi, Can somebody please convert this driver so that I can use it in ver 6.1? It's for a HP8594A spectrum analyser. It's just a matter of re-saving it from ver7.0 to ver6.1... so I'm told Thanks Attachments: hp859xx.zip ‏1591 KB

  • Email at Requisition Forward in E-Recruiting

    We want to generate email message to recruiter when requesting person forward the requisition to recruiter. Is there any enhancement exist which can be triggers when requester click on forward button on requisition page from portal? Regards Iftikhar