wood burning stoves*
The moose likes Other JSE/JEE APIs and the fly likes send a mail through servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "send a mail through servlet " Watch "send a mail through servlet " New topic
Author

send a mail through servlet

bharath cb
Greenhorn

Joined: Feb 09, 2012
Posts: 1
how to send a mail through servlet and to have conditions to set the message
Koen Aerts
Ranch Hand

Joined: Feb 07, 2012
Posts: 344

Does your servlet run in a J2EE environment? Then you can just use the classes from the javax.mail package.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61626
    
  67

Koen Aerts wrote:Does your servlet run in a J2EE environment? Then you can just use the classes from the javax.mail package.


J2EE is not necessary to use the mail package. Just be sure to include the needed jars.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Koen Aerts
Ranch Hand

Joined: Feb 07, 2012
Posts: 344

Bear Bibeault wrote:J2EE is not necessary to use the mail package.

That's right and I didn't say that. The thought I had attempted to bring across was that if you're using J2EE, it should already have the mail packages included and you can just use them. Yes, if you just have the Java SE then you need to add the mail packages from one or more jar files, which I believe may be called mail.jar and activation.jar.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: send a mail through servlet