Digitalus Webhosting & Webdesign - Mailscript

 

Be aware!
When using this script we assume you have at least some knowledge of HTML and how the web works.

 

A (contact) form:

Many people would like to have some sort of contact form on their website so people can get easily in touch with you or your company. Most of the time this is not as simple as it sounds. A contact form is a part of your website which requires changes to your website and even some additional files to process the information.

 

Code:

 <form action="gateway.php" method="post"> <!-- ONLY CHANGE THE VALUES BELOW WHEN NEEDED DO NOT DELETE --> <!-- THE (FIXED) SUBJECT WHICH IS USED IN THE MAIL --> <input type="hidden" name="intern_onderwerp" value="My test message" /> <!-- THE MESSAGE THAT'S GOING TO BE DISPLAYED AFTER THE MAIL HAS BEEN SENT --> <input type="hidden" name="melding_verzonden" value="Thanks for your message" /> <!-- REQUIRED FIELDS; SEPERATED,BY,A,COMMA --> <input type="hidden" name="verplichte_velden" value="name,phoneno" /> <!-- --> <!-- [VERPLICHT_VELD] ZAL VERVANGEN WORDEN VOOR DE NAAM (NAME) DIE U AAN HET VELD GEEFT --> <input type="hidden" name="melding_verplichte_velden" value="[VERPLICHT_VELD] is empty" /> <!-- THE CONTENT OF YOUR FORM. YOU CAN ADD FIELS IF YOU WANT, MAKE SURE THAT name IS UNIQUE --> <p><b>Name:</b><br /><input type="text" name="name" /></p> <p><b>Phonenumber:</b><br /><input type="text" name="phoneno"/></p> <p><b>Emailaddress:</b><br /><input type="text" name="emailaddress"/></p> <p><b>Comment:</b><br /><textarea name="comment"></textarea></p> <!-- ONLY CHANGE THE VALUES BELOW WHEN NEEDED DO NOT DELETE --> <p><input type="submit" value="Send form" /></p> </form>

 

When you put the code above in your website the following form will apear:

 

Example:

 

Name:

Phonenumber:

Emailaddress:

Comment:

 

N.B.: This form will not be sent.

 

 

When people send the form the following message will arrive in your mailbox:

 

Result:

 

Name:
Digitalus

Phonenumber:
0598630000

Emailaddress:
test@digitalus.tld

Comment:
This is a test message.

 

 

Installation:

  • Below you will find a link to the package you need. The files gateway.php and gateway.class.php need to be uploaded to your website. The best place to put them in is the directory which hosts your form.

  • In the file gateway.php you will need to change the e-mailaddress to your own address.

  • You can use the example code to put the form on your website. Just place it within one of your existing files.

  • You can add new elements to your form without changing the structore of the other files. Make sure you use an unique name for every element you add.

 

Files:

gateway.php [ view source ]

gateway.class.php [ view source ]

all files in ".zip" format [ download ]

all files in ".tar.gz" format [ download ]