JSP Sendmail with form data

Job ID: 34923952

Budget: £20 – £250 GBP

This is probably a pretty simple job. I have a JSP page web page with standard mail transport connecting to an smtp server that takes an input from a form and sends text/html emails to a set of recipients. This was all working fine. I need to add the ability to add an attachment (pdf file usually) to the outgoing email, selectable from the form. The form itself is working as it successfully uploads the file to the server, but the send page fails when sending the email with the attachment as a mimebody part. The code I am using has just been pasted from a template on stackoverflow or somewhere similar. So in summary it's working when sending emails without attachments, but the code I have added to provide attachment functionality has broken it and it now does not work, and I just do not have the time to sit through it and work out where my code is broken. See attached sample files