| 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: 56201
|
|
|
This is an a JSP? Very inappropriate. Move the code to a Java class.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35247
|
posted

0
|
Does anyone else is also getting similar error?
Hard to say, since you didn't tell us the actual error you got.
|
Android apps – ImageJ plugins – Java web charts
|
 |
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: 35247
|
posted

0
|
How are you importing that class?
But as Bear said, it's terrible design to do this kind of thing in a JSP.
|
 |
 |
|
|
subject: JSP Email
|
|
|