Generating and sending an email in the background on button press. Like a form. using php and JS

I have seen bits and pieces of this floating around here, but wanted to see if anyone has actually fully done this. I want to have two text input fields where the user will enter their name and email address accompanied by a submit button. Upon clicking the button I would like to pass those inputs as variables via JS to a php file that will generate and send and email to the instructor. Can anyone point me in the right direction?

4 Replies