One form - Two emails, I need some help please

From: Date: Tue, 29 Jan 2002 13:45:46 +0000
Subject: One form - Two emails, I need some help please
Groups: php.general 
Request: Send a blank email to php-general+get-82563@lists.php.net to get a copy of this message
Hi, I am trying to submit the contents of a form via email to a set address and then send a confirmation email based on the entered email address from the form. Sending the confirmation email works fine but the second email confirming delievery of the email is not working. Right now the script is not picking up the user email varible from the form. The email field name is biz_email and you can see where I set the varible in the script $mailto=$biz_email. When I test the form I get the first email without any problems but the second email comes back to me with the error stating the user is unknown and I see nobody@"domain name" in the To: field. So I guess the varible from the form is not being picked up. Any ideas Below is the relevent code - I would greatly appreciate any help - thanks if (isset($PHP_MAIL_FORM)) { include("classes/MailClass.php"); $tgFormMail=new phpMailer(); $mailto= "Webmaster Form Submission email address"; $subject="Basic Registration Submission Form"; $from="Website"; $FormMail_sent ="home.php"; if ($from ==""){ $lol =$HTTP_HOST; $a = str_replace ("www.","",$lol); $replaced = "webmaster@$a"; $from = $replaced; } if($subject ==""){ $subject ="Server Generated Email"; } $i=0; $arr = array($HTTP_POST_VARS); while(list($key, $val) = each($HTTP_POST_VARS)) { $mex = $mex."$key: $val\n"; } $FormMail->AddSender($from,$HTTP_HOST); $FormMail->AddAddress($mailto,$mailto); $FormMail->SetSubject($subject); $FormMail->AddBody($mex); $FormMail->Send(); if($tgFormMail_sent != ""){ header("Location: $FormMail_sent"); } } if ($PHP_MAIL_FORM=true){ include("classes/MailClass.php"); $FormMail=new phpMailer(); $mailto=$biz_email; $subject1="Your Submission has been recieved"; $message="Submission email body"; $FormMail->AddSender($from,$HTTP_HOST); $FormMail->AddAddress($to,$to); $FormMail->SetSubject($subject1); $FormMail->AddBody($messsage); $FormMail->Send(); if($tgFormMail_sent != ""){ header("Location: $FormMail_sent"); } }

« previous php.general (#82563) next »