Example of how to send email from PHP and use jquery and javascript to return a result to a div

Here’s what you need to do:

  • Download this file: http://www.porcaro.org/emailExample.zip
  • Unpack it and put it somewhere on a webserver

  • Edit email settings in emailExample/emailComment.php

Go to emailExample/emailExample.php in your browser and try it out.
If the output comes to a blank window it means something is wrong with your javscript setup.

I included the relevant javascript files in emailExample.zip.
If you want to download the latest javascript files, do the following

  • Download jquery-1.6.3.min.js and copy to emailExample.zip folder
  • Go to http://docs.jquery.com/Downloading_jQuery and pick grab the minified version. As of this writing it was here: http://code.jquery.com/jquery-1.6.3.min.js

  • Download jquery.form.js and copy to emailExample folder
  • Get it from http://jquery.malsup.com/form/#download