Tutorial 4

 
Web Hosting
EziHosting provides fast, reliable web hosting solutions in Australia for both business and web developers.
Check it out what we have to offer...
 
Add Your Link
You can add your web site's link to the EziDirectory.
This will increase your site's traffic and link popularity!
Learn more...

 
Domain Names

Web Design
We specialise in Australian Web Design.
The EziHosting team can design your web site in days.
Contact us today for a free consultation and quote.

EziHosting is proud to be a corporate World Vision Sponsor - find out more...

Find out more about your secure certificate here.
Security and privacy issues
Earn 50¢
per click!
Become an
affiliate!

  Do you need
Technical Support?

Home

WEB HOSTING
Web Hosting Australia

F.A.Q.

EziSupport

Control Panel

Dedicated Servers

Special

 

DOMAIN NAMES
Australian Domain Names

TLDs

Int. Domains

Policy Stuff

 

DIRECTORY
Listing

Add your Site

 

MISCELLANEOUS
Web Design

Search Engine Optimisation.

Free Site Analysis

Toos & Tutorials

2 Free Carts!

EziMerchant

Secure Certificates

 

CONTACT US
Contact Details

E-Mail Us

 

4. Creating a form-to-email gateway

Until now we have been collecting data from the user and displaying it back to the user in the form of a web page. Suppose you wish the contents of the form to be mailed either to yourself or the user.

We can create a simple script that sends a simple email to an address typed in by the user.

View the Basic CGI Program

Unlike the other scripts, this emails data to an address supplied by the person filling in the form. If this script was runnable here, it would allow anyone to email anyone else, with the web server as a return address. This is why a working version is not on this tutorial. You need to save the above code to your public_html directory and run it from there. That way, the return address will be set as the owner of the script (you).

sendmail or mail?
One other thing to note is the use of 'sendmail' rather than 'mail'. It is important to use 'sendmail' since this talks directly to the mail server. The path on your server (EziHosting Clients) to this is:

/usr/sbin/sendmail -t

The -t flag is necessary as it causes the sendmail program to read message for recipients.
To:, Cc:, and Bcc: lines will be scanned for people to send to. (The Bcc: line will be deleted before transmission.)

Don't forget the blank line between the email headers and the start of the message.

Back

We hope this tutorial was helpful. If you like, you can link to our tutorials from your web site. Just use the following code:

<a href="http://www.ezi-hosting.com/tutorials.htm">Free Scripting Tutorials from EziHosting</a>

 

 

 

Web Hosting Australia Monthly Special


At EziHosting, the Australian Web Hosting company,
we strive to become your internet technology partner
for the long run...

© 2003 EziHosting Australian Web Hosting - All Rights Reserved