aspose file tools*
The moose likes Other JSE/JEE APIs and the fly likes JSP Email Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "JSP Email" Watch "JSP Email" New topic
Author

JSP Email

Virendra Chandak
Greenhorn

Joined: Jun 25, 2010
Posts: 4
Hi,

I am using the following code to send email using JSP through gmail.

But i am getting error in the following line:
Session mailSession = Session.getDefaultInstance(props, null);





Does anyone else is also getting similar error?

Or do you have any better way to send email using jsp.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61764
    
  67

This is an a JSP? Very inappropriate. Move the code to a Java class.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42918
    
  68
Does anyone else is also getting similar error?

Hard to say, since you didn't tell us the actual error you got.
Virendra Chandak
Greenhorn

Joined: Jun 25, 2010
Posts: 4
Sorry, about that

In the line
Session mailSession = Session.getDefaultInstance(props, null);

I am getting the following error:

Session cannot be resolved to a type
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42918
    
  68
How are you importing that class?

But as Bear said, it's terrible design to do this kind of thing in a JSP.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP Email