Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Sep 2002
    Location
    Parts Unknown
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Error with Javamail attachments

    Hi,

    I am trying to send an email with an attachment from an HTML form using javamail in a JSP. In testing from my local machine running Apache with JDK 1.3.1, the email and the attachment arrive perfectly, and the "thank you" html page generated by the JSP displays great.

    I uploaded the form and JSP page to my web server (Unix with JRUN) and now the email is not sent and I receive the following error on the top of the "thank you" page generated by the JSP:

    "javax.mail.SendFailedException: Sending failed; nested exception is:
    javax.mail.MessagingException: IOException while sending message;
    nested exception is: java.io.FileNotFoundException: C:\file.txt(No
    such file or directory)"

    I am assuming that there is something different about the way my web server handles file attachments but I can't find any information about how to fix the problem. Any help is greatly appreciated.

    Thanks

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That seems fairly simple...

    C:\file.txt

    is a local file on your machine... you probably need to reference the (existing) file on your server the same way you would another .jsp page or directory, for example.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #3
    New to the CF scene
    Join Date
    Sep 2002
    Location
    Parts Unknown
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I think that's the problem too, but I don't know where the file uploads on the server.

    This worked fine when I did it from Apache loaded on my local machine. I guess because it kmew where to get the attachment file. How do I tell it where to put the file on the web server?

    Thanks

  • #4
    New to the CF scene
    Join Date
    Sep 2002
    Location
    Parts Unknown
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    bttt

  • #5
    New to the CF scene
    Join Date
    Oct 2005
    Location
    VietNam
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile Help me!

    I want send message with files.
    How are you attachment files?
    Tell me about your solutions.
    thanks!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •