Go Back   Dreamweaver Club Forums > Hand Coders Forum > PHP
Register FAQ Members List Search Today's Posts Mark Forums Read

Thread Tools Display Modes
Old 11-03-2013, 10:54 AM   #1
Join Date: Nov 2013
Posts: 2
Default send for tutorial

OK, pulling my hair out now.
I have been using Ramandeeps tutorial "using dreamweaver and PHP to send form results in an email" for ages on the wifes website and it works great. Now she wants me to add a "bcc" email address.
I have tried all sorts of code tweaks obtained from google but each time the code fails until I change it back to the original.
Can anyone guide me in the right direction?? Have attached the code below for ease.


//--------------------------Set these paramaters--------------------------

// Subject of email sent to you.
$subject = 'Results from Contact form';

// Your email address. This is where the form information will be sent.
$emailadd = 'mail@rdsnetworks.net';

// Where to redirect after form is processed.
$url = 'http://www.rdsnetworks.net/confirmation.html';

// Makes all fields required. If set to '1' no field can not be empty. If set to '0' any or all fields can be empty.
$req = '0';

// --------------------------Do not edit below this line--------------------------
$text = "Results from form:\n\n";
$space = ' ';
$line = '
foreach ($_POST as $key => $value)
if ($req == '1')
if ($value == '')
{echo "$key is empty";die;}
$j = strlen($key);
if ($j >= 20)
{echo "Name of form element $key cannot be longer than 20 characters";die;}
$j = 20 - $j;
for ($i = 1; $i <= $j; $i++)
{$space .= ' ';}
$value = str_replace('\n', "$line", $value);
$conc = "{$key}:$space{$value}$line";
$text .= $conc;
$space = ' ';
mail($emailadd, $subject, $text, 'From: '.$emailadd.'');
echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';
loadie is offline   Reply With Quote
Old 11-04-2013, 12:29 AM   #2
edbr's Avatar
Join Date: Aug 2005
Location: Bali
Posts: 11,202

if you want a true bcc, a quick down and dirty way would be to add an extra mail()
$emailadd2 = 'mail2@rdsnetworks.net';  //bcc address

than modify
mail($emailadd, $subject, $text, 'From: '.$emailadd.'');

mail($emailadd, $subject, $text, 'From: '.$emailadd.'');
mail($emailadd2, $subject, $text, 'From: '.$emailadd.'');
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote
Old 11-04-2013, 12:59 PM   #3
Join Date: Nov 2013
Posts: 2

Proper job! Brilliant

loadie is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 01:24 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com