wood burning stoves*
The moose likes JSP and the fly likes Mail with attachment using jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Mail with attachment using jsp" Watch "Mail with attachment using jsp" New topic
Author

Mail with attachment using jsp

biny panackal
Ranch Hand

Joined: Apr 12, 2007
Posts: 72
HI,
Can i send a mail with attachment using JSP. I tryd some code but finally it came to a stage that i have to upload the file to server befor attaching. I dont want to upload the file to server. Expecting some good comment for this problem

email: binypanackal@gmail.com


Biny Balan
binypanackal@gmail.com
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18708
    
    8

Certainly you can send e-mail with attachments using JSP. (It would be much better to do that in a servlet or a bean rather than a JSP, but if you really must, you can put scriptlets in your JSP.)

But naturally you can only attach data that is on the server where the JSP is running. So if there's a file on the client's machine that needs to be attached to an e-mail that you want to send from the JSP, that file has to be uploaded from the client to the server. No way around that.
biny panackal
Ranch Hand

Joined: Apr 12, 2007
Posts: 72
dear sir,
Thank you for your replay.If i am using servlet insted of jsp.Can i upload a file in client machine..? Do you have any code to do this. IF so could you send it to me.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42358
    
  64
Can i upload a file in client machine..?


Various ways are discussed in: FileUpload. Would you want to upload manually or programmatically? Do you have an FTP server running on the web server machine?


Ping & DNS - my free Android networking tools app
 
jQuery in Action, 2nd edition
 
subject: Mail with attachment using jsp