Email form submission without using php

Sani Evans

I'm working on a project that's on a small scale for now. It's more about presentation and less about security.

All I need to do is have a form that will be filled out, then the user clicks submit and all the information collected from the form will be sent to a specified 'mailto:address'. I know that it would make a lot more sense to do this using php, but for now I only have html/css to work with.

Is there a way I can submit everything on the form to an email address? It can open up the user's email handler, but it doesn't have to.

I have 11 text fields and 2 sets of radios.

ncubica

Well, what you are asking is totally possible, and I think the selected right answer is wrong. Take a look and read these two links:

Customize mailto links http://blog.escapecreative.com/customizing-mailto-links/

The default action of mailto depends on the browser so, if you try it and my solution could not work in your browser the cause may be for this reason: Configuring mailto Mailto links do nothing in Chrome but work in Firefox?

Here is the jsfiddle: http://jsfiddle.net/g3qazhf8/ and I'm using jquery to make my life easier:

javascript

function sendEmail(){
   var answerArr = [];
   $("input, textarea").each(function(){       
       if($(this).attr("type") === "radio"){            
           if($(this).is(":checked")){
              answerArr.push($(this).val());
           }
       }else{
          answerArr.push($(this).val());       
       }
   });

    var body = answerArr.join("\n");
    var mailto = "[email protected]";

    var a = document.createElement('a');
    a.href = "mailto:" + mailto + "?body=" + escape(body);
    console.log(a.href);
    a.click();
}

$(document).on("click",".submit",sendEmail);

HTML

<textarea> your message </textarea>
<input type="text" placeholder="name" name="name" />
<input type="text" placeholder="lastname" name="lastname" />
<label>
<input type="radio" name="rboption" value="yes" /> YES
</label>
<label>
<input type="radio" name="rboption" value="no" />NO
</label>
<br>
<a href="#" target="_blank" style="display:inline-block; background:#333; color:#FFF; padding:5px 10px 5px 10px; margin:15px 0 0 0; text-decoration:none" class="submit">Sent the email</a>

Btw, you should try the solution on your localhost. I will attach an image proving that it's working: enter image description here enter image description here

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Send email from html form without php

From Dev

Modal form Submission to PHP using Jquery .ajax

From Dev

Form submission to incorrect URL PHP

From Dev

Modal Form Submission without refresh

From Dev

Orchard CMS Send Email to Multiple/Different Email Addresses Upon Form Submission Using Workflows

From Dev

Send email when Google Form submission is updated

From Dev

Using jQuery AJAX to call a php page on form submission

From Dev

HTML form post PHP file on submission rather than sending an email

From Dev

Form submission using AngularJS/AJAX

From Dev

Keep form data inside the field after submission using php

From Dev

how to clear form using php PDO after successful submission

From Dev

Form Submission through Ajax and PHP

From Dev

Form Submission to Self (PHP)

From Dev

PHP Form Submission without a client

From Dev

php:using two buttons inside same form and form submission

From Dev

How to pass variables to a CFC on Form submission without using hidden fields?

From Dev

How to do something before form submission without using preventing default

From Dev

send email after form submission

From Dev

Send Email after form submission via email service such as Mailchimp

From Dev

Using PHP form validation on jQuery form submission

From Dev

PHP email form without Refreshing Page

From Dev

Form submission opens php page

From Dev

PHP contact form submission

From Dev

Delayed form submission using JQuery

From Dev

Sending email from html form using php

From Dev

php coding Form submission to server using php

From Dev

Sending form data to an email after a successful submission using codeigniter

From Dev

Website (HTML) Read Only Form Email Submission

From Dev

PHP, email submission form

Related Related

  1. 1

    Send email from html form without php

  2. 2

    Modal form Submission to PHP using Jquery .ajax

  3. 3

    Form submission to incorrect URL PHP

  4. 4

    Modal Form Submission without refresh

  5. 5

    Orchard CMS Send Email to Multiple/Different Email Addresses Upon Form Submission Using Workflows

  6. 6

    Send email when Google Form submission is updated

  7. 7

    Using jQuery AJAX to call a php page on form submission

  8. 8

    HTML form post PHP file on submission rather than sending an email

  9. 9

    Form submission using AngularJS/AJAX

  10. 10

    Keep form data inside the field after submission using php

  11. 11

    how to clear form using php PDO after successful submission

  12. 12

    Form Submission through Ajax and PHP

  13. 13

    Form Submission to Self (PHP)

  14. 14

    PHP Form Submission without a client

  15. 15

    php:using two buttons inside same form and form submission

  16. 16

    How to pass variables to a CFC on Form submission without using hidden fields?

  17. 17

    How to do something before form submission without using preventing default

  18. 18

    send email after form submission

  19. 19

    Send Email after form submission via email service such as Mailchimp

  20. 20

    Using PHP form validation on jQuery form submission

  21. 21

    PHP email form without Refreshing Page

  22. 22

    Form submission opens php page

  23. 23

    PHP contact form submission

  24. 24

    Delayed form submission using JQuery

  25. 25

    Sending email from html form using php

  26. 26

    php coding Form submission to server using php

  27. 27

    Sending form data to an email after a successful submission using codeigniter

  28. 28

    Website (HTML) Read Only Form Email Submission

  29. 29

    PHP, email submission form

HotTag

Archive