aspose file tools*
The moose likes Java in General and the fly likes Update Fields via email response Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Update Fields via email response" Watch "Update Fields via email response" New topic
Author

Update Fields via email response

rahull agarwal
Ranch Hand

Joined: Dec 20, 2010
Posts: 31
Hi,

I have a web application running on JBoss.

When an entity is created in the system, the system sends out an email to the approver.

Currently, the approver has to login to the system and approve/reject it.

Is it possible that the approver replies to the email with words "approve" or "reject" and system changes the status of this entity?

Any pointers will be highly appreciated.

Thanks..
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19762
    
  20

Sure. Just send the email from an existing email account. The replies go into this account, after which you can read them through JavaMail. You can then investigate the emails subject and body and do whatever you need to based on their contents.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
rahull agarwal
Ranch Hand

Joined: Dec 20, 2010
Posts: 31
Rob Spoor wrote:Sure. Just send the email from an existing email account. The replies go into this account, after which you can read them through JavaMail. You can then investigate the emails subject and body and do whatever you need to based on their contents.


Thanks so much.

Will you be able to elaborate this?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18909
    
    8

Elaborate? What part of it did you not understand?
rahull agarwal
Ranch Hand

Joined: Dec 20, 2010
Posts: 31
Paul Clapham wrote:Elaborate? What part of it did you not understand?


Say my application is www.myApplication12378.com

It sends an email from support@myApplication12378.com

User replies to this email.

How will JavaMail know that email was sent? The mail will go out to SMTP server. right?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18909
    
    8

rahull agarwal wrote:
Paul Clapham wrote:Elaborate? What part of it did you not understand?


Say my application is www.myApplication12378.com

It sends an email from support@myApplication12378.com

User replies to this email.

How will JavaMail know that email was sent? The mail will go out to SMTP server. right?


The user's reply comes into your e-mail server. Not your SMTP server of course, because SMTP is for sending e-mail. But it will come into your e-mail server, whatever it is. Then you can use JavaMail to search your e-mail server via IMAP or POP3, whichever it supports.
rahull agarwal
Ranch Hand

Joined: Dec 20, 2010
Posts: 31
Paul Clapham wrote:
rahull agarwal wrote:
Paul Clapham wrote:Elaborate? What part of it did you not understand?


Say my application is www.myApplication12378.com

It sends an email from support@myApplication12378.com

User replies to this email.

How will JavaMail know that email was sent? The mail will go out to SMTP server. right?


The user's reply comes into your e-mail server. Not your SMTP server of course, because SMTP is for sending e-mail. But it will come into your e-mail server, whatever it is. Then you can use JavaMail to search your e-mail server via IMAP or POP3, whichever it supports.


You all have helped me a lot. let me research further.

But a quick note.. So, Javamail can actually go into exchange server and search/read emails? Really?

thanks so much.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61658
    
  67

What do you think JavaMail does?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
rahull agarwal
Ranch Hand

Joined: Dec 20, 2010
Posts: 31
Bear Bibeault wrote:What do you think JavaMail does?


I should rather go and research myself.. It looks like I am looking for "spoon feeding" here :-)

I will get back with any questions if I have.

Thanks everyone
rahull agarwal
Ranch Hand

Joined: Dec 20, 2010
Posts: 31
It all makes sense now.. I looked into JavaMail API and it all seems to easy and smooth now..

Thanks everyone. I am marking this post as resolved.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18909
    
    8

Great! Just one suggestion: the JavaMail download includes a directory of sample programs. I recommend you have a look at those, and then when you are ready to start coding, use them as a basis for your own code. There's (all right, TWO suggestions) also a JavaMail FAQ which you should be able to google up pretty quickly. Lots of useful information there.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Update Fields via email response