Taking out the middle-man
Author |
Message |
copthesaint

|
Posted: Fri Dec 09, 2011 10:10 am Post subject: Taking out the middle-man |
|
|
I was wondering if anyone would know how to forward an email from something like outlook directly to a program.
This way the program wouldn't have to consistently check for an email. I know this is alot to ask, however any information will help me. |
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
copthesaint

|
Posted: Fri Dec 09, 2011 11:11 am Post subject: RE:Taking out the middle-man |
|
|
Actually just thinking about it as well,
If I were to OLE Outlook with java would it be possible for java to know when Outlook would recieve an email? |
|
|
|
|
 |
DemonWasp
|
Posted: Fri Dec 09, 2011 11:19 am Post subject: RE:Taking out the middle-man |
|
|
E-mail is, by design, a client-active system. That is, the client requests new messages from the server, which replies appropriately. The server never contacts the client independently; it always just sits there waiting for clients to connect.
When Outlook (or any other program) "receives" an email, that's because it explicitly asked some mail server somewhere to deliver new mail, and that server said it had new mail. Outlook, by default, does this every few minutes. GMail's web UI does it every minute or so. Many email clients check infrequently (or not at all) on their own: you have to ask it to do so, which is a holdover from an era when the resources used to request / transfer new email were nontrivial.
You might be able to hook up Java to Outlook via some OLE library. The better question is: should you? Do you absolutely need to be receiving emails? What are you trying to do? Why doesn't your Java program just ask for the email itself? Why are you writing this particular thing in Java (it would seem that a language better suited to communicating with Outlook might be a better choice -- mostly MS-specific languages, such as VB/C#)? |
|
|
|
|
 |
2goto1

|
Posted: Fri Dec 09, 2011 11:23 am Post subject: RE:Taking out the middle-man |
|
|
What are you trying to accomplish and why do you need to check Outlook from a Java program?
Using Java, you can "take out the middle man" by creating an email client. Which is a program that would continually run, checking for new emails. No need to have to check Outlook or even have Outlook installed. Would that approach work for your need? |
|
|
|
|
 |
copthesaint

|
Posted: Tue Dec 13, 2011 10:00 am Post subject: RE:Taking out the middle-man |
|
|
I am trying to make a program that depends mostly on external programs so that the program itself doesn't need much maintenance. The program simply takes information from a TN3270 plus email manipulates the data then sends opens the data in an excel program as an excel file.
What I need to do is figure out how to setup OLE on outlook so it can open within java, since this program is going to be used by people who may be completely computer illiterate. |
|
|
|
|
 |
2goto1

|
Posted: Tue Dec 13, 2011 2:57 pm Post subject: RE:Taking out the middle-man |
|
|
If you run into hurdles setting up OLE on Outlook so it can open within Java, you can probably accomplish the same task in pure Java:
- Read an email by creating a Java email client
- Process the data from the email
- Create a tab delimited file
- Either email the tab delimited file to the appropriate person, or launch Excel with Runtime.exec() and pass the tab delimited file as an argument to Excel
Whether one approach is more maintenance than another is arguable. My gut feeling is that the approach with the fewest external dependencies may be less maintenance simply because there will be fewer moving parts and fewer software dependencies required to support it.
Good luck, let us know how your OLE experience turns out. |
|
|
|
|
 |
copthesaint

|
|
|
|
 |
|
|