Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your first option of directly connecting to the mailserver is actually pretty straightforward.</p> <p>We do something pretty similar by logging in to our Exchange server using JavaMail: a Java application connects to Exchange on a regular basis and processes any mail it finds. Once it has processed an email, it moves it to another folder so it doesn't get processed again.</p> <p>I don't quite understand how your second option would work, but connecting up Java code to Outlook sounds difficult more difficult to me.</p> <p>Here's an outline of how to use JavaMail to process emails on an Exchange server. It should work for any mailserver that supports IMAP:</p> <pre><code>public void processMailExample() { Store store = session.getStore(new javax.mail.URLName("imap://user:pass@mailserver...")); store.connect(); Folder inputFolder = store.getFolder("INBOX"); Folder outputFolder = store.getFolder("INBOX/Processed"); inputFolder.open(Folder.READ_WRITE); Message[] messages = inputFolder.getMessages(); for (Message message : messages) { // Process message here moveMessage(message, outputFolder); } } public void moveMessage(Message m, Folder to) throws MessagingException { m.getFolder().copyMessages(new Message[] {m}, to); m.setFlag(Flag.DELETED, true); m.getFolder().expunge(); } </code></pre> <p>If a particular email has attachments then it will be an instance of <code>javax.mail.internet.MimeMessage</code> rather than just <code>Message</code>. The <code>MimeMessage</code> class gives you full access to all attachments, HTML, etc so you should be able to access everything you need to upload into your CRM system.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload