Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Email servlet  RSS feed

 
Jason Kwok
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a form that allows a user to enter in their email address and a message. When the user posts the form contents to my servlet, I want the servlet to then send it to a mail recipient.

I already know how to send and retrieve the request parameters, I just need some direction on how to take those parameters and email them to an existing email account.

Thanks for any help on this!!
Jason
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you try to use JavaMail ?
http://java.sun.com/products/javamail/
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66205
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to the Other Java APIs forum.
 
Jason Kwok
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Satou,

I'm still somewhat new to Java, so to be honest, I didn't even know JavaMail existed!! I'll definitely take a look at that.

Thanks,
Jason
 
dema rogatkin
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why don't you use a form with e-mail action? I think action should look like action="mailto:jaddressbook@google.com", so browser will pack all parameters and send to recipient using current e-mail settings. You do not need even do any processing in servlets. However if you want to send e-mail form servlet then look in to:
Here is caller code:

Here is mail send class:
 
Paul Clapham
Sheriff
Posts: 22502
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why don't you use a form with e-mail action? I think action should look like action="mailto:jaddressbook@google.com", so browser will pack all parameters and send to recipient using current e-mail settings.
I really hate it when websites do that. I don't have an e-mail client on my computer, I use one of those Hotmail-like services, so it doesn't do anybody any good.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!