php mail function with bcc

the mail() function

Moderators: macek, egami, gesf

fawadmz
New php-forum User
New php-forum User
Posts: 5
Joined: Wed Nov 21, 2012 12:15 am

php mail function with bcc

Postby fawadmz » Fri Jul 19, 2013 11:39 pm

Helo all
I want to use php mail function . such that there is one to address and three bcc adresses. i have tried several ways but not of them worked.
can you please give me a link on this or write a sample code that have used one to address and three or more bcc addresses.
Thanks alot .

cappy2354
New php-forum User
New php-forum User
Posts: 5
Joined: Fri Jul 19, 2013 11:07 am

Re: php mail function with bcc

Postby cappy2354 » Tue Aug 13, 2013 7:39 am

Code: Select all

$to = "email to send to";
$subject = "Subject here";
$message = "Put your message in here";
$headers .= 'FROM: email from' . "\n".
                 'Reply-To: reply to email' . "\n".
                 'X-Mailer: PHP/' . phpversion() . "\n";
$headers .= 'Return-Path: return path email' . "\n";
$headers .= 'Bcc: email toBcc, another email to Bcc, another email to Bcc' ."\n";
$headers .= 'MIME-Version: 1.0' . "\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
mail($to,$subject,$message,$headers);

I think that should work if you insert your info into the proper areas.

johnj
php-forum Super User
php-forum Super User
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: php mail function with bcc

Postby johnj » Thu Aug 15, 2013 8:51 am

it is better to have the bcc addresses after specifying the content type


Return to “PHP coding => Mail”

Who is online

Users browsing this forum: No registered users and 0 guests

cron