How to send email with Nodemailer using Gmail account in Node.js ? How to send data of HTML form directly to JSON file? I stumbled upon "SP.Utilities.Utility.SendEmail" in my searches. It's usually more than enough for small websites. To submit a form via AJAX, your script will need to handle four tasks: Capture the form submit button so that the default action does not take place. With a web API, however, the response body is usually either empty or contains structured data, such as JSON. In the action property, we can define the email of the sender using the mailto link in the form of HTML. For a more visually appealing form that matches your branding, you'll have to add lines of code specific to your needs. The task is to send data of HTML form directly to JSON file. Approach: We have an HTML form containing several fields such as name, college, etc. For example: