#native_company# #native_desc#
#native_cta#

Sending Mail With PHP3 Page 2

By Tim Perdue
on July 30, 2000

Basically, you can receive some parameters from a simple form
(you can probably handle creating that. If not – take a look at
geocrawler.com
and steal the HTML from the mail archive – you have my blessing).

<?php

//$to_email_address - received from the "POST"

//$from_email_address - ditto

//$subject

//$message

//

//First, validate the addresses using Jons' function

//

$to_email_array=validateEmail $to_email_address );

$from_email_array=validateEmail $from_email_address );

//

//Second, test the results and send the message or display

//an error

//

if (( $to_email_array[0]) && ($from_email_array[0])) {

   mail($to_email_address,$subject,$message,'FROM: '.$from_email_address);

} else {

   //DISPLAY AN ERROR

   echo "error";

   echo 
$to_email_array[1];

   echo 
$from_email_array[1];

}

?>



And you’re done…
That same little task, were I using $1000 dollar products like
Lasso would have required me to install extra software (javamail API +
the JDK if I didn’t already have it), and would have taken tons of
extra code and some Lasso-specific libraries.
Care to guess where I stand on the free software movement?