Solved

PHP Code to Mail CC:

Posted on 2013-01-15
2
417 Views
Last Modified: 2013-01-15
How would I add a courtesy copy CC: email address to this code? The variable for the email address is named $Email2

Below is the code I have now:

if (mail($Email, $Subject, $Message, $Headers))

Open in new window


I've tried different variations such as putting the $Email2 in different locations. The email still sends but the subject line is the email address if I add the variable to as such:

if (mail($Email, $Email2, $Subject, $Message, $Headers))

I actually don't need it to CC:, if I could just fix it so the $Email2 is on the TO: line, that would also be fine.
0
Comment
Question by:wantabe2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 27

Accepted Solution

by:
Lukasz Chmielewski earned 500 total points
ID: 38779856
You need to look to the $Headers:
http://php.net/manual/en/function.mail.php
Like Example #4
0
 
LVL 15

Author Closing Comment

by:wantabe2
ID: 38780079
Cool website & thanks! I referenced the top 4 lines of example 4 & it worked like a charm!
0

Featured Post

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question