• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to send a mail from a jsp?

 
Arul Jose
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

we tried the following code. its not working.

has any one of you tried this before?


ARUL JOSE

 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

its not working

What exception are you seeing? Where do you define your SMTP server details?
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15205
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you using the class sun.net.smtp.SmtpClient?

Read this:
Why Developers Should Not Write Programs That Call 'sun' Packages

You should use JavaMail instead of using the 'sun' packages.

And just saying "it doesn't work" is not a good way to ask a question; please read this:
How To Ask Questions On Java Ranch
 
Dave Salter
Ranch Hand
Posts: 293
Java Mac OS X Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's an article explaining how to use JavaMail.
 
Anu satya
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

You can refer to my thread at:
http://www.coderanch.com/forums/

the code which i used there is exactly working fine.

Please note, i am uploading a .csv file and sending mail. You can modify that code according to your requirement.

Please note : way2= the "String-type" path where the file to be sent an email is located.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64613
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to Other Java APIs.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic