Re: mail prob

From: Date: Fri, 23 Feb 2001 06:34:03 +0000
Subject: Re: mail prob
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-41273@lists.php.net to get a copy of this message
On Fri, 23 Feb 2001 16:52, W.D. wrote: > <form method="POST" action="<?php print ($PHP_SELF);?>"> > First Name: <input type=TEXT name="FirstName" size=15><p> > Last Name: <input type=TEXT name="LastName" size=25><p> > E-mail Address: <input type=TEXT name="Email" size=25><p> > <textarea name="Info" rows="5" cols="40" wrap=SOFT>Ask a > Question</textarea><p> > <input type=SUBMIT> <input type=RESET> > </font> > </form> > > > <?php > $from = $FirstName ." ". $LastName; > $subject = $Email; > $message = $Info; > mail("webmaster@domain.com, info@domain.com, $subject, $message, > $from); ?> > You seem to have gotten a little confuzzed here! $from should contain the email address which you are collecting as $Email and presumably $Info is the message body and I'm not quite sure what you want in the subject, but all you have available is first and last names! And then, you need a check to see what action should be taken when you call this script - at the moment every time you open the script you send, or try to send, an empty mail. Perhaps assigning a name and value to your submit button and testing for that? -- David Robley | WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet | http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA

« previous php.general (#41273) next »