Sunday 16 April 2023

Send Email on form submit

 This post will help you to send emails to the website admin, While someone fills out the contact/feedback or message form on the website. The whole task will be achieved using only HTML, No server side or any other backend code is required. 

This kind of email service is provided by https://formsubmit.co/. Just paste the sample form code on your webpage.

<form action="https://formsubmit.co/your@email.com" method="POST">

    <input type="text" name="name" required>

    <input type="email" name="email" required>

    <button type="submit">Send</button>

</form>


For more settings visit: https://formsubmit.co/

Sample Code

Take the name, phone, and dropdown list selection with a message. After submitting the form user will be redirected to the given webpage i.e. thankyou.html.

<form method="post" action="https://formsubmit.co/youremail">

    <input type="hidden" name="_next" value="thankyou.html">

    <input type="hidden" name="_subject" value="Subject of mail">

    <select class="form-control" id="Tour" name="Tour">

        <option value="India">India</option>

        <option value="Nepal">Nepal</option>

        <option value="Bhutan">Bhutan</option>

      

    </select>

    <br>

    <input type="text" name="Name" placeholder="Name" class="form-control" required>

    <br>

    <input type="text" name="Phone" placeholder="Phone Number" pattern="[0-9]{10}" title="Only Ten Digit number is allowed" class="form-control" required>

    <br>

    <input type="email" name="Email" placeholder="Email" class="form-control">

    <br>

    <textarea class="form-control" placeholder="Message" name="Message"></textarea>

    <br>  

        <input type="submit" value="Send" class="btn btn-success" name="submit">

     

</form>


                                                              Next Topic

No comments:

Post a Comment