logo-dw

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

Reply
 
Thread Tools Display Modes
Old 11-03-2013, 10:54 AM   #1
loadie
 
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.

Thanks
loadie


<?php
//--------------------------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
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,164
Default

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


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


to
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
loadie
 
Join Date: Nov 2013
Posts: 2
Default

Proper job! Brilliant

thanks
loadie
loadie is offline   Reply With Quote
Reply


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:58 AM.


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