Emailing to table field result using PHP form
2 posts by 2 authors in: Forums > CMS Builder
Last Post: May 8, 2011 (RSS)
By (Deleted User) - May 6, 2011
I have a multi-record set up that includes an email field
<?php echo $dealersRecord['email'] ?>
I want to use that email address as the "TO" field when I email a particular person the result of a form.
My form currently uses a standard email in the $to field. I'd like to CC that plain email address and have the $to email address be the result of <?php echo $dealersRecord['email'] ?>
BELOW Is the form processing. Your feedback is appreciated. Thanks.
<?
$first = $_POST['first'];
$last = $_POST['last'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$interest = $_POST['interest'];
$additional = $_POST['additional'];
$to = "myemail@yahoo.com";
$subject = "Subject";
$subject2 = "No Reply: We've received your message.";
$body = "Please contact the following person:
Name: $first $last
Phone: $phone
Email Address: $email
Interested In: $interest
Additional Information: $additional
";
$body2 = "Thank you so much for taking an interest in our work and we will be in contact with you shortly.";
$header = "From: $email\n";
$header2 = "From: Us";
mail($to, $subject, $body, $header);
mail($email, $subject2, $body2, $header2);
echo "
<h1>Thank you for contacting us.</h1>
<p>Your request has been received and someone will respond shortly.</p>
"?>
<?php echo $dealersRecord['email'] ?>
I want to use that email address as the "TO" field when I email a particular person the result of a form.
My form currently uses a standard email in the $to field. I'd like to CC that plain email address and have the $to email address be the result of <?php echo $dealersRecord['email'] ?>
BELOW Is the form processing. Your feedback is appreciated. Thanks.
<?
$first = $_POST['first'];
$last = $_POST['last'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$interest = $_POST['interest'];
$additional = $_POST['additional'];
$to = "myemail@yahoo.com";
$subject = "Subject";
$subject2 = "No Reply: We've received your message.";
$body = "Please contact the following person:
Name: $first $last
Phone: $phone
Email Address: $email
Interested In: $interest
Additional Information: $additional
";
$body2 = "Thank you so much for taking an interest in our work and we will be in contact with you shortly.";
$header = "From: $email\n";
$header2 = "From: Us";
mail($to, $subject, $body, $header);
mail($email, $subject2, $body2, $header2);
echo "
<h1>Thank you for contacting us.</h1>
<p>Your request has been received and someone will respond shortly.</p>
"?>
Re: [kimamel] Emailing to table field result using PHP form
By gkornbluth - May 8, 2011
Hi Kimamel,
Here's a post that might offer a clue,
http://www.interactivetools.com/iforum/Products_C2/CMS_Builder_F35/gforum.cgi?post=77190
I also did a search on BCC and came up with a few other tidbits.
Haven't got a lot of time right now.
Hope these help.
Jerry Kornbluth
Here's a post that might offer a clue,
http://www.interactivetools.com/iforum/Products_C2/CMS_Builder_F35/gforum.cgi?post=77190
I also did a search on BCC and came up with a few other tidbits.
Haven't got a lot of time right now.
Hope these help.
Jerry Kornbluth
The first CMS Builder reference book is now available on-line!
Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php
Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php