0

I am new with servlets. I have created MySQL database. User will upload file(or more than one files). Then automatically mail should be send to respective user who will upload file. please suggest me how to do this?. I have read about JAVA Mail API but I don't know how to use it. Is there any other way to do it? please suggest.

Note:- I don't want to send an email to one user. I want to send mail to that user who will upload file.

This is index.jsp page that I have created.

<form action="UploadServletClass" method="post" enctype="multipart/form-data">

  <center>
    <h1>Welcome to Document Management System...</h1>
  </center>

  <table width="400px" align="center" border="2">
    <tr>
      <td align="center" colspan="2">Form Details</td>
    </tr>

    <tr>
      <td>First Name</td>
      <td>
        <input list="firstnamelist" required="" name="firstname" />
      </td>
    </tr>

    <tr>
      <td>Last Name</td>
      <td>
        <input list="lastnamelist" required="" name="lastname" />
      </td>
    </tr>

    <tr>
      <td>Division</td>
      <td>
        <input type="text" required="" name="division" />
      </td>
    </tr>

    <tr>
      <td>Reporting Unit</td>
      <td>
        <input type="text" required="" name="reportingunit" />
      </td>
    </tr>

    <tr>
      <td>Document Number</td>
      <td>
        <input type="text" required="" name="documentnumber" />
      </td>
    </tr>

    <tr>
      <td>Document Name</td>
      <td>
        <input type="text" required="" name="documentname" />
      </td>
    </tr>

    <tr>
      <td>Document Uploader</td>
      <td>
        <input type="text" required="" name="documentuploader" />
      </td>
    </tr>

    <tr>
      <td>Document Owner</td>
      <td>
        <input type="text" required="" name="documentowner" />
      </td>
    </tr>
    <tr>
      <td>Document Type</td>
      <td>
        <select name="Document_Type">

          <option value="Agreement">Agreement</option>
          <option value="Contract">Contract</option>
          <option value="PO">PO</option>
          <option value="Invoice">Invoice</option>
          <option value="COA">COA</option>
          <option value="Lease Deed">Lease Deed</option>
          <option value="AMC">AMC</option>
          <option value="Direct Material">Direct Material</option>
          <option value="Indirect Material/Services">Indirect Material/Services</option>

        </select>
      </td>
    </tr>
    <br><br>
    <tr>
      <td>Document Category</td>
      <td>
        <select name="Document_Category">
          <option value="Customer">Customer</option>
          <option value="Vendor">Vendor</option>
          <option value="Internal">Internal</option>

        </select>
      </td>

    </tr>
    <br><br>

    <tr>
      <td>Mail id</td>
      <td>
        <input type="email" required="" name="mailid" />
      </td>
    </tr>

    <tr>
      <td>Select File</td>
      <td>
        <input type="file" name="fileName" multiple="multiple" />
      </td>
    </tr>

    <tr>
      <td></td>
      <td>
        <input type="submit" value="Submit" name="Submit" />
      </td>
    </tr>
  </table>
</form>

0 Answers0