Solved

php mail function with bcc,cc and reply-to

Posted on 2003-11-01
4
827 Views
Last Modified: 2013-12-12
can somebody please help me with the php code for sending emails.

the code must include the from,reply-to,cc,bcc and the message.

please i need it urgently.
0
Comment
Question by:josiah007ng
4 Comments
 
LVL 3

Expert Comment

by:red010knight
ID: 9664695
First off how is the data getting to php? using Post, Get or command line/auto script -- although it doesn't really matter, it does affect the setup code that must be placed before the actual calls.

Second what platform are you using?

http://us2.php.net/manual/en/function.mb-send-mail.php

The above link should be able to get you started. Unfortunately cc and bcc does not seem to be supported to the best of my ability to test. Though it might be in 5, but it doesn't say whether it does or not.

Hope this helps,
Happy coding,
Red010Knight
0
 
LVL 13

Accepted Solution

by:
lozloz earned 50 total points
ID: 9664908
if you're using the function mail(), you need to attach these parameters in the headers

<?
$headers = "From: me@address.com\r\n";
if($cc) { $headers .= "Cc: $cc\r\n"; }
if($bcc) { $headers .= "Bcc: $bcc\r\n"; }
if($reply) { $headers .= "Reply-To: $reply\r\n"; }
# e.g. mail("someone@domain.com", "Greetings", "This is a message", $headers);
?>
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.

821 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