aspose file tools*
The moose likes Other JSE/JEE APIs and the fly likes how to send a mail from a jsp? 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 "how to send a mail from a jsp?" Watch "how to send a mail from a jsp?" New topic
Author

how to send a mail from a jsp?

Arul Jose
Ranch Hand

Joined: Jan 14, 2005
Posts: 131
hi,

we tried the following code. its not working.

has any one of you tried this before?


ARUL JOSE

Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


its not working

What exception are you seeing? Where do you define your SMTP server details?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14435
    
  23

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


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Dave Salter
Ranch Hand

Joined: Jul 20, 2005
Posts: 293

Here's an article explaining how to use JavaMail.
Anu satya
Ranch Hand

Joined: Mar 17, 2005
Posts: 146
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.


With Regards,
Anu
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61770
    
  67

Moved to Other Java APIs.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to send a mail from a jsp?