Click here to Skip to main content
15,892,927 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
how to send email from HTML Contact form to gmail


Dear All,
I want to send email from HTML form to gmail.
I want to upload attach a PDF / Word file and send it to the receipent.

Please help.

Thanks.

What I have tried:

<body>

<form method="post" action="mailto:test@gmail.com">
<table width="100%" border="1">
  <tr>
    <td><table width="30%" border="1" align="center">
      <tr>
        <td> </td>
        <td> </td>
      </tr>
      <tr>
        <td>Name</td>
        <td>
          <label>
            <input type="text" name="textfield" />
            </label>
             </td>
      </tr>
      <tr>
        <td>Email</td>
        <td><input type="text" name="textfield2" /></td>
      </tr>
      <tr>
        <td> </td>
        <td> </td>
      </tr>
      <tr>
        <td> </td>
        <td>
          <label>
            <input type="submit" name="Submit" value="Submit"/>
            </label>
        </form>
        </td>
      </tr>
    </table></td>
  </tr>
</table>
</body>
Posted
Updated 27-Aug-17 5:21am

1 solution

It cannot be done in HTML since it's just a markup language.

If you insist on doing it from the client side, you have to do it using javascript.

JavaScript Quickstart | Gmail API[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900