Solved

PHP Code to Mail CC:

Posted on 2013-01-15
2
402 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
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 You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article discusses how to create an extensible mechanism for linked drop downs.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now