Welcome to PHmail

Phmail enables you to receive email responses from forms on your website. You will need a hosting service that allows to to run PHP scripts. You'll also need to be able to make minor edits in the code view of an authoring package such as Dreamweaver, or open your pages in a text editor. I recommend the excellent (and free) Notepad 2.

Getting started

  1. Download the mail script and unzip it with something like Winzip
  2. Create a web page page to serve as a response page. This can be in the style of the rest of your site. Make sure it has a .php extension e.g. thankyou.php
  3. Create another web page containing the form for your visitor to fill. This page can have a .htm or .html extension. You can use all form objects and as many as you like.
  4. In code view, look for the form tag. Edit it so that the action refers to your thank you page.
      <form method="POST" action="thankyou.php">
  5. Save the page.
  6. Open your thank you page and paste the following code into the place where you want the response to go.
      <?php
    
        /**************************************************/
        ###Put your own email address between the quotes ###	
    	
    	define("MAILTO", "your_email_here");
    	    
        ### Everything else is optional ###    
        /**************************************************/
                
        #add your own required fields separated by commas, e.g. name, email
        #case sensitive
        #example:- define("REQUIRED","name, email");
    	define("REQUIRED", "      ");
    		    
        #define any fields you want to exclude e.g. submit
        #case sensitive
        #example:- define("EXCLUDE","submit");
    	define("EXCLUDE", "      ");
    		    
        #edit mail subject
    	define("MAIL_SUBJECT", "My Web Page response");
    		    
        #edit missing fields message.	
    	define("MISSING_FIELDS", 
    	"<p><strong>Oops, you missed out some fields.</strong> 
    	<br />Please use your browser's back button to return to the form</p>");
    	
    	include("phmailer.php");
      ?>
  7. Save the files.
  8. Upload all files to the same directory

That's it. Your form should now send email to the address you inserted in the thank you page

PHMail is still a work in progress and I'd be grateful for any comments you may have.

Please use the following form to send your responses

Name:
Email:
Comments: