How to retrieve mails from outlook or hotmail?

Hello all,
How do I retrieve mails from hotmail or outlook using javamail. I am very new to javamail. Please give some idea.
Thanks,
mamata.

sorry u can't.
not from hotmail because u don't know the server address of hotmail.
and not from outlook b'cause that is yet another Mail Transfer Agent like Java mail API.
hope that helps.
bye

Similar Messages

  • How to retrieve mails from a Mail Server ? PLEASE REPLY IF YOU KNOW !

    Hello,
    I am trying to retrieve mail from a mail server using the example from JGuru. The command line is as follows:
    java GetMessageExample mail.wlfdle1.on.home.com (Mail Server Name) <username> <password>
    I should be prompted to read the messages in your INBOX. Enter YES to see the message content.
    0: [email protected] Thanks.
    Do you want to read message? [YES to read/QUIT to end]
    YES
    Blah Blah Blah
    1: [email protected] No Thanks.
    Do you want to read message? [YES to read/QUIT to end]
    YES
    Blah Blah Blah Blah
    I do not get any error or any output.
    Any Clue or any idea how I can get some result ??
    Response will be appreciated.
    Thanks.

    This is the sample program from jguru. After executing the following command (replacing the mail server, username, and password):
    java GetMessageExample POP.Server username password
    You'll be prompted to read the messages in your INBOX. Enter YES to see the message content.
    0: [email protected] Thanks.
    Do you want to read message? [YES to read/QUIT to end]
    YES
    Blah Blah Blah
    1: [email protected] No Thanks.
    Do you want to read message? [YES to read/QUIT to end]
    YES
    Blah Blah Blah Blah
    import java.io.*;
    import java.util.Properties;
    import javax.mail.*;
    import javax.mail.internet.*;
    public class GetMessageExample {
    public static void main (String args[]) throws Exception {
    String host = args[0];
    String username = args[1];
    String password = args[2];
    // Create empty properties
    Properties props = new Properties();
    // Get session
    Session session = Session.getDefaultInstance(props, null);
    // Get the store
    Store store = session.getStore("pop3");
    // Connect to store
    store.connect(host, username, password);
    // Get folder
    Folder folder = store.getFolder("Inbox");
    // Open read-only
    folder.open(Folder.READ_ONLY);
    BufferedReader reader = new BufferedReader (
    new InputStreamReader(System.in));
    // Get directory
    Message message[] = folder.getMessages();
    System.out.println(folder.getMessages());
    for (int i=0, n=message.length; i<n; i++) {
    // Display from field and subject
    System.out.println(i + ": " + message.getFrom()[0]
    + "\t" + message[i].getSubject());
    System.out.println("Do you want to read message? [YES to read/QUIT to end]");
    String line = reader.readLine();
    if ("YES".equals(line)) {
    // Display message content
    System.out.println(message[i].getContent());
    } else if ("QUIT".equals(line)) {
    break;
    // Close connection
    folder.close(false);
    store.close();
    Please help me on this.
    thanks.

  • How to get mail from Outlook to SAP GUI (workflow)

    Hi All ,
    How can we get a mail from outlook or personal mail into SAP GUI .
    can it be used as an event for 'wait for event step ' in workflow . ?
    Thanks ,
    Naval bhatt

    Hi Naval,
    I just want to clarify some areas from your question:
    1. Will a workflow be triggered because of the email from Outlook to SAP? Does it always have to start from the Outlook side?
    The integration of SAP Workplace (thru Workflow) and Outlook is possible using the Extended Notification (tcode SWNCONFIG). Here, you can send an email from SAP to Outlook then execute a function from your Outlook message and then you will be directed to the tcode of SAP side (SAP GUI).
    Regards,
    Reymar

  • Any one know how to retrieve mail from entourage in Lion?

    Entourage is not supported in Lion. I am looking for a solution to import mail from entourage into Mail without going back to Snow Leopard. Any suggestions?

    Okay, I am going to try downloading the trial version of Office for Mac with Outlook and see if it will find my Entourage 2004 emails/contacts.  Then I will move them to Mail.  I will report back if it works.  (Not sure if Lion already ate all my email though!)

  • How to retrieve appoinments from outlook calendar efficiently

    I can now successfully retrieve different appointments/meetings from different outlook calendars thanks to the documentation provided online. The only issue I have with is its efficiency. The application could handle 100 users and I believe
    that the application would run slow.  See the sample code below.
    service.AutodiscoverUrl("USER EMAIL", RedirectionUrlValidationCallback);
    FindItemsResults<Appointment> appointments = service.FindAppointments(WellKnownFolderName.Calendar, new CalendarView("START DATE", "END DATE"));
    //check each appointment
    foreach (Appointment app in appointments)
    "DO SOMETTHING WITH THE APPOINTMENT"
    If you need more details please let me know.
    Thank you in advance

    Another option would be to use the GetUserAvailiblity operation
    http://msdn.microsoft.com/en-us/library/office/hh532567(v=exchg.80).aspx this won't give you the same level of access to the calendar appointments as FindItems but it will return basic calendaring information for 100 users at a time in one op.
    Cheers
    Glen

  • How to retrieve mail from /var/mail??

    When I open the terminal window I see the message "You Have New Mail". Right before quitting terminal I also see a message saying "Held 2 messages in /var/mail/julian".
    How can I access those e-mails? I don't find any options in the Mail application.
    Thanks for your help,
    Julian

    Type 'mail' into the Terminal window without the quote marks to get your mail. More information on this command is available here.
    (10369)

  • How to skip dialogue box which ask you to confirm the operation when your used labview to send an e-mail from Outlook?

    I'm using Labview to send an e-mail from outlook and everytime I got a dialogue box which inform that a software is trying to send an e-mail. To send this e-mail I have to confirm operation. How can I avoid this dialogue box ?

    I don't know what code you're using but the attached VI works with my version of Outlook and doesn't have any pop-up messages. I downloaded it from somewhere a while ago but don't remember where it was from.
    Attachments:
    Email_sender.vi ‏54 KB

  • Retrieving Mails from Exchange or from outlook 2010 using TSQL

    Hi,
    Will you please provide step by step queries to retrieve mails from directly from Exchange Server or else retrieving mails from the outlook 2010 which is connected Exchange Server.
    I have SQL Server 2012 developer edition, outlook 2010 and no idea what version of Company Exchange Server available.
    I google this solution but not successful. Mostly example i found old Exchange or SQL Server 7.0
    Thanks.

    Hi Visakh,
    Will you please assist here :
    EXEC sp_addlinkedserver 'exchange',
    'Exchange OLE DB provider',
    'exoledb.DataSource.1',
    'file:\\.\backofficestorage\localhost\public folders'
    - I don't have "Exchange OLE DB Provider"(exoledb.DataSource.1) in my Linked Server connection, from where can I download so that it can view in SQL Server Linked Servers.
    Will you please let me know the path('file:\\.\backofficestorage\localhost\public folders'), what exactly it is. Is it .pst/.ost file location.
    Thanks.
    Best Regards
    Kashif Chotu

  • HT204053 How do I set up my Mac to auto retrieve mail from icloud?

    How do I set up my Mac to auto retrieve mail from icloud?

    Welcome to the Apple Community.
    If you can't get your mail to work on Snow Leopard after June 30, you might want to try one of these approaches
    1. Configuring Mail in Snow Leopard
    2. Delete your mail account from Mail preferences and set it up again using the Mail Server Information.
    Some users have apparently encountered issues using this information in pre-Lion set ups (I haven't), Roger Wilmut has kindly provided instructions for those who find themselves with this problem.
    Entering iCloud email settings manually in Snow Leopard or Leopard

  • HT201250 How to recover mails of outlook from time machine

    How to recover mails of outlook from time machine

    This worked for me:
    From Time Machine, restore a good backup of the entire  "/Users/james/Library/Application Support/Address Book"  folder to a different location, like to a folder on your desktop.   
    (note: the Library folder typically won't show up in Finder. To make it visible, in Terminal, issue this command:
            defaults write com.apple.finder AppleShowAllFiles YES     
            then restart Finder:  killall Finder  )
    Go offline.  Do whatever you need to do to get completely disconnected from the internet (turn off Wireless, unplug the ethernet cable, etc.).  Otherwise, iCloud will immediately overwrite your restore.
    Delete the real folder:  /Users/james/Library/Application Support/Address Book
    Copy your restore (at the different location), to the real location ( /Users/james/Library/Application Support/Address Book )
    Restart Contacts.  Your restored data you want should be there.  Before going online again, Export all these contacts (File - Export - etc...)
    Go online again.  iCloud will wipe out your Address Book with what's on iCloud. Re-import contacts as needed from your Export.

  • How to get All Mails from outlook

    Hi am reading mail from outlook.. It reads only unread mails. But i want to read all mails. if any one knows please help me..My code is..
    import javax.mail.*;
    import javax.mail.internet.*;
    import java.util.*;
    import java.io.*;
    public class AllPartsClient {
      public static void main(String[] args) {
    Properties props = new Properties();
        String host = "myhost";
        String username = "myuser";
        String password = "mypass";
        String provider = "pop3";
        try {
          Session session = Session.getDefaultInstance(props, null);
          // Connect to the server and open the folder
          Store store = session.getStore(provider);
          store.connect(host, username, password);
          Folder folder = store.getFolder("INBOX");
          if (folder == null) {
            System.out.println("Folder " + folder.getFullName() + " not found.");
            System.exit(1);
        folder.open(Folder.READ_ONLY);
          // Get the messages from the server
          Message[] messages = folder.getMessages();
          for (int i = 0; i < messages.length; i++) {
            System.out.println("------------ Message " + (i+1)
             + " ------------");
            // Print message headers
            Enumeration headers = messages.getAllHeaders();
    while (headers.hasMoreElements()) {
    Header h = (Header) headers.nextElement();
    System.out.println(h.getName() + ": " + h.getValue());
    System.out.println();
    // Enumerate parts
    Object body = messages[i].getContent();
    if (body instanceof Multipart) {
    processMultipart((Multipart) body);
    else { // ordinary message
    processPart(messages[i]);
    System.out.println();
    // Close the connection
    // but don't remove the messages from the server
    folder.close(true);
    catch (Exception e) {
    e.printStackTrace();
    // Since we may have brought up a GUI to authenticate,
    // we can't rely on returning from main() to exit
    System.exit(0);
    public static void processMultipart(Multipart mp)
    throws MessagingException {
    System.out.println("mp.getCount() = "+mp.getCount());
    for (int i = 0; i < mp.getCount(); i++) {
    processPart(mp.getBodyPart(i));
    public static void processPart(Part p) {
    try {
    String fileName = p.getFileName();
    String disposition = p.getDisposition();
    String contentType = p.getContentType();
    if (fileName == null && (Part.ATTACHMENT.equals(disposition)
    || !contentType.equalsIgnoreCase("text/plain"))) {
    // pick a random file name. This requires Java 1.2 or later.
    fileName = File.createTempFile("attachment", ".txt").getName();
    if (fileName == null) { // likely inline
    p.writeTo(System.out);
    else {
    File f = new File(fileName);
    // find a version that does not yet exist
    for (int i = 1; f.exists(); i++) {
    String newName = fileName + " " + i;
    f = new File(newName);
    FileOutputStream out = new FileOutputStream(f);
    // We can't just use p.writeTo() here because it doesn't
    // decode the attachment. Instead we copy the input stream
    // onto the output stream which does automatically decode
    // Base-64, quoted printable, and a variety of other formats.
    InputStream in = new BufferedInputStream(p.getInputStream());
    int b;
    while ((b = in.read()) != -1) out.write(b);
    out.flush();
    out.close();
    in.close();
    catch (Exception e) {
    System.err.println(e);
    e.printStackTrace();
    In this code if Content is Multipart then it is not displaying content..
    Thanks

    Hi
    if i use String provider = "imap"; then it shows the following error message..
    javax.mail.MessagingException: Connection refused: connect
    at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:479)
    at javax.mail.Service.connect(Service.java:275)
    at javax.mail.Service.connect(Service.java:156)
    at javamail.AllPartsClient.main(AllPartsClient.java:39)
    Caused by: java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:364)
    at java.net.Socket.connect(Socket.java:507)
    at java.net.Socket.connect(Socket.java:457)
    at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:232)
    at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:189)
    at com.sun.mail.iap.Protocol.<init>(Protocol.java:84)
    at com.sun.mail.imap.protocol.IMAPProtocol.<init>(IMAPProtocol.java:87)
    at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:446)
    ... 3 more
    pls any one give idea

  • Export mail from outlook 2002 for Entourage 2004 - how to?

    Hi.
    I've tried for some time now to export my mail from outlook 2002 for Entourage.. Can't say it's been easy, and I still haven't figured it out.
    Can anyone help me with this..
    and .. oh yes.. I'm a newbie at mac.. got it for only about a week or so now..
    please bare with me..

    I don't use contacts but I found this document that should help:
    http://docs.info.apple.com/article.html?artnum=302268
    However it does specify Outlook 2003 or later is required to sync contacts so that will be an issue for you.

  • How to exchange E-mail from Outlook?

    After an update of the software of the N97 to version 12, I had to install again the exchange option with Outlook. Contacts, Agenda, Tasks, ... works fine, but I can't get the mail exchange working again.
    My purpose is just to load the mails of say 5 days from Outlook into the N97. In the Ovi Suite I have chosen: 
    Nokia PC sync instellingen: I have chosen E-mail, too; folder: Inbox; exclusief e-mails bigger than 200 kb.
    I think I do something wrong on the N97-side (and can't remember what I did right the very first time).
    Is it right to chose a mailbox: @home
    use as a usernaam the name I use in Outlook
    use as a password the password I use in Outlook
    use the same server for incoming mails as I use in Outlook
    use a standardconnection
    Mailboxname: the name after @Home
    use as Mailboxtype the same I use in Outlook: POP3
    use as port: standard?
    First I would like to have this working.
    Even better would be if I could use two mailboxes: 1 for e-mails from Outlook; 2 for e-mails from a different source via internet.
    Message Edited by loriot on 22-Sep-2009 05:08 PM

    As I can't believe that no one here knows the anwser, I think my description and/or title is unclear.
    It's about synchronization between the N97 and Outlook, but the problem I have only with synchronizing E-mails between the N97 and Outlook; synchronizing agenda, contacts, tasks, ... works well. 
    Message Edited by loriot on 23-Sep-2009 07:01 AM

  • How do I import mail from Outlook 2010?

    When I try to import my emails from Outlook 2010 I get the following message:
    "An error occurred importing mail from Outlook
    Unable to find mail to import. Check to make sure the mail application is correctly installed on this machine."

    You'll need to do it from a 32bit version - Mail/Live mail do not recongise outlook 2010 64 bit.  Dropping EML files into Outlook folder has always created new messages with attachments - this is nothing new.
    ETA: if you can email the messages as attachments, you can drag them from the message and drop them in the Inbox.  This obviously works best if there aren't hundreds of messages to convert. :)
    There are 3rd party utilties that can make the conversion but they may not work with the 64bit version. See http://www.slipstick.com/config/convmsg.htm for a list of programs that can make the conversion but i don't know if any of them work with 64bit outlook.
    Diane Poremsky [MVP - Outlook]
    Outlook Tips: http://www.outlook-tips.net/
    Outlook & Exchange Solutions Center: http://www.slipstick.com

  • How to migrate mails from Google Apps to MS Exchange Online IMAP (Getting error)

    Any tips on How to migrate mails from Google Apps to MSOL? What is required? When I am trying to migrate using IMAP but getting fpollowing error
    =======================
    Summary: 1 item(s). 0 succeeded, 1 failed.
    Elapsed time: 00:00:11
    [email protected]
    Failed
    Error:
    Failed to log on successfully for the following reason:
    Server rejected Basic login with following message : * CAPABILITY IMAP4rev1 UNSELECT LITERAL+ IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 UIDPLUS COMPRESS=DEFLATE.
    Exchange Management Shell command attempted:
    'Microsoft.Exchange.Transporter.Provider.PopImap.InternetMailboxMeta' | Move-XsIMAPMailboxToExchangeOnline -AllowUnsecureConnection $false -TargetCredential 'System.Management.Automation.PSCredential' -MaxThreadCount '10' -Quiet
    Elapsed Time: 00:00:11
    ======================
    Any help will be much appreciated.
    Regards
    Sunil DK

    I just finished migrating a client from Google Apps to Microsoft Exchange Online using the IMAP option in the Microsoft Online Services Migration Tool.  
    I added the mailboxes by creating a CSV file [i.e. GoogleApps(Gmail)_Mailboxes.csv] in the following format:
    SourceIdentity,SourceServer,SourceLoginID,SourcePassword,TargetIdentity
    [email protected],imap.gmail.com,[email protected],P@ssword1,[email protected]
    [email protected],imap.gmail.com,[email protected],P@ssword2,[email protected]
    [email protected],imap.gmail.com,[email protected],P@ssword3,[email protected]
    Then I created a custom folder map XML file [i.e. GoogleApps(Gmail)_FolderMap.xml] to map the Google Apps (Gmail) labels to the appropriate Exchange (Outlook) mailbox folders and create those that didn't exist (i.e. Important, Starred, Follow up,
    Misc, Priority) as sub-folders under the Inbox:
    <?xml version="1.0" encoding="utf-8"?>
    <FolderMappings xmlns="http://tempuri.org/FolderMap.xsd">
    <!-- This xml contains the mapping of foldername in source server to folders in target server -->
    <!--
    "path" is the name of the folder in source server
    "Name" is the name of the folder to be mapped into target server
    "SpecialFolder" is the name of the special folder to be mapped into
    target server (Name will be ignored) valid values are :
    Inbox
    Calendar
    Tasks
    Sent Items
    Deleted Items
    Drafts
    Junk E-mail
    Contacts
    Outbox
    Journal
    Notes
    "Description" Description of the folder
    "ExcludeFolder" indicates folders to exclude. Valid values are:
    true (case sensitive)
    false (case sensitive)
    0
    1
    -->
    <!-- Default Mapping Section -->
    <Folder path = "INBOX">
    <Property SpecialFolder = "Inbox"/>
    </Folder>
    <Folder path = "New Mail">
    <Property SpecialFolder = "Inbox"/>
    </Folder>
    <Folder path = "[Root]">
    <Property SpecialFolder = "Inbox"/>
    </Folder>
    <Folder path = "">
    <Property SpecialFolder = "Inbox"/>
    </Folder>
    <Folder path = "Calendar">
    <Property SpecialFolder = "Calendar"/>
    </Folder>
    <Folder path = "Tasks">
    <Property Name = "Migration items/Tasks"/>
    </Folder>
    <Folder path = "Sent Items">
    <Property SpecialFolder = "Sent Items"/>
    </Folder>
    <Folder path = "Sent Mail">
    <Property SpecialFolder = "Sent Items"/>
    </Folder>
    <Folder path = "Sent">
    <Property SpecialFolder = "Sent Items"/>
    </Folder>
    <Folder path = "Deleted Items">
    <Property SpecialFolder = "Deleted Items"/>
    </Folder>
    <Folder path = "Trash">
    <Property SpecialFolder = "Deleted Items"/>
    </Folder>
    <Folder path = "Drafts">
    <Property SpecialFolder = "Drafts"/>
    </Folder>
    <Folder path = "Draft">
    <Property SpecialFolder = "Drafts"/>
    </Folder>
    <Folder path = "Junk E-mail">
    <Property SpecialFolder = "Junk E-mail"/>
    </Folder>
    <Folder path = "Spam">
    <Property SpecialFolder = "Junk E-mail"/>
    </Folder>
    <Folder path = "Contacts">
    <Property Name = "Migration Items/Contacts"/>
    </Folder>
    <Folder path = "Outbox">
    <Property SpecialFolder = "Outbox"/>
    </Folder>
    <Folder path = "Journal">
    <Property SpecialFolder = "Journal"/>
    </Folder>
    <Folder path = "Notes">
    <Property SpecialFolder = "Notes"/>
    </Folder>
    <Folder path = "Public Folders">
    <Property ExcludeFolder = "true"/>
    </Folder>
    <!-- Google Apps (Gmail) Specific Mapping Section -->
    <Folder path = "[Gmail]/All Mail">
    <Property ExcludeFolder = "true"/>
    </Folder>
    <Folder path = "All Mail">
    <Property ExcludeFolder = "true"/>
    </Folder>
    <Folder path = "[Gmail]/Drafts">
    <Property SpecialFolder = "Drafts"/>
    </Folder>
    <Folder path = "[Gmail]/Important">
    <Property Name = "Inbox/Important"/>
    </Folder>
    <Folder path = "[Gmail]/Sent Mail">
    <Property SpecialFolder = "Sent Items"/>
    </Folder>
    <Folder path = "[Gmail]/Spam">
    <Property SpecialFolder = "Junk E-mail"/>
    </Folder>
    <Folder path = "[Gmail]/Starred">
    <Property Name = "Inbox/Starred"/>
    </Folder>
    <Folder path = "[Gmail]/Trash">
    <Property SpecialFolder = "Deleted Items"/>
    </Folder>
    <!-- Custom Mapping Section -->
    <Folder path = "Follow up">
    <Property Name = "Inbox/Follow up"/>
    </Folder>
    <Folder path = "Misc">
    <Property Name = "Inbox/Misc"/>
    </Folder>
    <Folder path = "Priority">
    <Property Name = "Inbox/Priority"/>
    </Folder>
    </FolderMappings>
    Additionally, I had to tell the Internet E-mail Mailbox Migration Wizard to use the "Individual Account Credentials" option since I was able to specify each account password in the CSV file when adding the mailboxes to Microsoft Online Services Migration
    Tools console.
    Just to note, the users had to manually export their contacts to a CSV file and calendars to iCal (ICS) files in order to import those items into Outlook.
    I hope this will benefit others since Microsoft doesn't seem to have a custom, specifically defined migration strategy for this scenario.  With Google Apps being in direct competition with BPOS/Office365, I assumed that Microsoft would have a simple
    strategy using something like ActiveSync to facilitate the migration of email, contacts, calendar entries, etc.  Hopefully we'll see something along those lines become available in a future release of the migration tools.
    --Jon Payne

Maybe you are looking for