php contact form

This is a discussion on "php contact form" within the PHP Forum section. This forum, and the thread "php contact form are both part of the Program Your Website category.



 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1  
Old Jun 11th, 2007, 05:44
Reputable Member
Join Date: Mar 2007
Location: Kenya
Age: 20
Posts: 213
Thanks: 0
Thanked 0 Times in 0 Posts
php contact form

Hello Forumz
I have this in my contact form. Its working but I want it to send a cc to a different email or to send to multiple emails. Can someone pliz help me?
PHP: Select all

$my_email "myemail@habari.co.tz";

$continue "/";

if (
$_SERVER['REQUEST_METHOD'] != "POST"){exit;}

if(!(isset(
$_SERVER['HTTP_REFERER']) && !empty($_SERVER['HTTP_REFERER']) && stristr($_SERVER['HTTP_REFERER'],$_SERVER['HTTP_HOST']))){print "Please enable referrer logging to use this contact form. Your message was not sent."; exit;} 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Jun 11th, 2007, 07:52
Junior Member
Join Date: Jun 2007
Location: IRan
Age: 19
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Re: php contact form

ou can user this function for sending mail:
mail($to, $subject, $body);

and for some mail you can make an array and do this :

$array=array("mail1","mail2","mail3");
$number=count($array);
for($i=0 $i<$numberl $i++){
mail($array[$i+1], $subject, $body);
}

i think that it works, try.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Jun 13th, 2007, 23:20
Junior Member
Join Date: Jun 2007
Location: Los Angeles
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Re: php contact form

You can also do this:

$to = 'joe@aol.com,mary@aol.com,henry@earthlink.net');
mail($to, $subject, $body);

RalphF
http://www.GoldRushWebHosting.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Jun 14th, 2007, 05:29
Reputable Member
Join Date: Mar 2007
Location: Kenya
Age: 20
Posts: 213
Thanks: 0
Thanked 0 Times in 0 Posts
Re: php contact form

Thanks guys that worked out fine. Is it possible to have a cc and bcc on it? cc is not that important because I can use the one above but a bcc would be something different from that. right?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Jun 14th, 2007, 14:19
Junior Member
Join Date: Jun 2007
Location: Los Angeles
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Re: php contact form

As far as I know, there is no way to specify a CC: or BCC: using the mail() function.

RalphF
GoldRushWebHosting.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Jun 14th, 2007, 16:59
Reputable Member
Join Date: Feb 2006
Location: London
Age: 25
Posts: 103
Thanks: 0
Thanked 1 Time in 1 Post
Re: php contact form

you can send bcc and cc with mail(), see below:

PHP: Select all

$to 'someone@somewhere.com';

$subject 'some subject'
$message 'Cakes and pies! CAKES AND PIES!';

$headers 'To: Mary <mary@example.com>' "\r\n";
$headers .= 'From: Birthday Reminder <birthday@example.com>' "\r\n";
$headers .= 'Cc: birthdayarchive@example.com' "\r\n";
$headers .= 'Bcc: birthdaycheck@example.com' "\r\n";

// Mail it
mail($to$subject$message$headers);
?> 
If you want to bcc/cc more than one person, I think you just separate the email addresses with a comma.

Hope that helps
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
contact form

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] PHP contact form redirect to same form Posie PHP Forum 14 Jan 29th, 2008 20:28
help with asp contact form? Ella Classic ASP 4 Jan 2nd, 2008 00:45
what is the best contact form Phixon Web Page Design 10 May 15th, 2007 18:47
Contact us form help! NurseJenny PHP Forum 10 Jun 23rd, 2006 13:27
Need Quote Form and Contact Form Av8er Flash & Multimedia Forum 5 Oct 30th, 2003 17:14


All times are GMT. The time now is 23:22.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42