473,382 Members | 1,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

How to receive Contact form to multiple email addresses

I have created a Contact form. I want to receive users emails to 3 emails at once. How do i Do it ?? How to add CC or BCC ?

My submit.php CODE :

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. if($_POST) {
  3.  
  4.     $fname = $_POST['fname'];
  5.     $email = $_POST['email'];
  6.     $question  = $_POST['question'];
  7.     $cntry = $_POST['country'];
  8.     $city  = $_POST['city'];
  9.  
  10.     $to = "questions@gmail.com";
  11.     $subject = "AJ Web site";
  12.     $body = "NAME :".$fname.", "." Email :".$email." Country :".$cntry.", "." City : ".$city.", "." ### Comments :".$question;
  13.  
  14.     if (mail($to, $subject, $body)) {
  15.         echo("<script>alert('Message successfully sent!');</script>");
  16.         echo("<script>window.location.href='http://www.mywebsite.com/';</script>");
  17.     }
  18.     else
  19.         echo("<script>alert('Message delivery failed...');</script>"); 
  20.  
  21. }
  22.  
  23. ?>
  24.  
thanks & Regards,
Ajinkya
Feb 8 '11 #1
3 2293
Dormilich
8,658 Expert Mod 8TB
you add CC and BCC like you add the From header (which btw. you have forgotten to do). see mail() (and examples)
Feb 8 '11 #2
Im not from Javascript background. Im just a web designer + bt i know how to edit code.

Can you please help me ? paste the code !
Feb 8 '11 #3
Dormilich
8,658 Expert Mod 8TB
mail headers have nothing to do with Javascript. and I think the given example is descriptive enough.
Feb 8 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: dave | last post by:
Hello, I'm creating a site that has several contact email addresses. These are vlid addresses, i'm wondering if i can use php to alter these addresses so that spam harvesters can't get them, yet a...
1
by: james00_c | last post by:
Greetings- I need to pass multiple email addresses to a "sendto" hidden field in a form. I need to do that because "CC" and "BCC" are not an option. One address webmaster@xyz.com would be...
2
by: Jim Fox | last post by:
Thought maybe I could do this with a hyperlink field in a table...........but doesn't seem to be working. I basically got a vendors table with all the contact info. One of the fields is EMAIL...
1
by: Arne Beruldsen | last post by:
I have a customer database with email addresses. How do I use WebMail to send out a monthly newsletter? Thanks...Arne
4
by: SAL | last post by:
I am using a RegularExpressionValidator control on my ASP page, and I have the ValidationExpression property set to "Internet E-mail Address". The email address is valiated when the user puts in a...
1
by: TCB | last post by:
How can I separate multiple email addresses entered in a single textbox, the email addresses are separated by (,) or (;) Thanks
1
by: donet programmer | last post by:
Is there a way to map multiple email addresses, for instance emailadd1@domain.com, emailadd2@domain.com.. etc to one email address emailadd@domain.com such that when an email is sent to emailadd1...
0
by: krouxsa | last post by:
Hi There people... Please help me with this query. I want to send 1 email to multiple email addresses stored in a database. Will it be possible? I'm using SQL Server 2005 and already set up...
3
by: dragonfly8563 | last post by:
Hi all, I created a listbox with employees' names and email addresses in it, and a button which grabs email address once it's clicked. Currently I can only pick up one address at a time, but I...
21
by: farisallil | last post by:
Hi I have a table called Info with a column called Email Address in it. I want to create a command button in a form called Customer ,which has the Info table as the Record Source, and I want this...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.