I am using java mail package to send attachments in my email. I have few questions regarding this. 1) When i do attach the file on to my email, it works fine on my windows machine. It doesn't work on unix machine, it throws FileNotFoundException, saying c:\test.doc not found. Do i have to store this file temporarily on the server or how does this email attachment work on unix system. 2) Also, is there any limit on the size of the attachment file? 3) Also, if i attach multiple files, does the size limit to combined attached files or individual attached files? Appreciate your input, Thanks.
Thanks for the reply. I agree with having emial_home property. Does that mean the attached file must exist on the server side to solve this path issue. Our server is running on sun solaris m/c and client(browser) on PC. When i attach a file in my email, do i need to store this attached file temporarily on the server to send the email? Thanks. Please let me know, Appreciate your help.
hi Mandy, i dont get u. which server r u talking about? Email Server to which ur JavaMail program sends emails to be sent out? where is your Java Mail program? I guess its on the client side (downloaded thru applet or u know something like that)...if its not on the client side then how u r invoking it? sorry but i am kinda lost about what exactly u r having and how u r accessing??? can u please clarify more on this? thanks maulin.
Hi, Sorry for the confusion. What i meant by server was my WebServer. I am not talking about the email server here. I have Weblogic server running on sun m/c, which is running my email program and a servlet(servlet invokes my email program). From the browser when i invoke this servlet, it will generate a form to specify subject, body part, from address, to address & file attachment capability. When i attach my local file(file that exists on my PC) to this form and when i click on Send Email button, it throws a FileNotFoundException. So, my question is should i store this attached file temporarily on my weblogic server until the email is sent? After sending i can delete this file. Any further help on this would be greatly appreciated. Thanks.
Mandy, remember that your servlet and/or JSP is running on the web server and then sending the generated response to the client browser via the HTTP connection created for the response. It certainly does not have access to the filesystem of the client (imagine the security ramifications of that were that possible). If you want your server to have access to the file, you will either need to store it on the server, or somehow make the filesystem of the system where you will be storing the file available via a mechanism other than HTTP. hth, bear
Joined: Jun 26, 2001
Thanks Bear Bibeault! So, i am planning to temporarily store the file under tmp directory on the server(webserver) until the email attachment is sent. After the email attachment has been sent, i will delete this file from tmp directory from my webserver. Thank you.