Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP Email

 
Virendra Chandak
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65225
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is an a JSP? Very inappropriate. Move the code to a Java class.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you importing that class?

But as Bear said, it's terrible design to do this kind of thing in a JSP.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic