i wrote a small script in PHP to send mail $headers = 'To: mail.com $headers = 'From: from name mail $headers = 'Cc: inc cc $headers .= 'Bcc: inc bcc (this header is not working) Code (markup): script sends to and cc but do not to bcc
Err, that code won't run.. you're not even ending the php strings with '; Anyway, if you have a problem, it's best if you look at http://www.php.net/mail (in this case). The below code is straight from that page. Not hard to find, right? // Additional headers $headers .= 'To: Mary <mary@example.com>, Kelly <kelly@example.com>' . "\r\n"; $headers .= 'From: Birthday Reminder <birthday@example.com>' . "\r\n"; $headers .= 'Cc: birthdayarchive@example.com' . "\r\n"; $headers .= 'Bcc: birthdaycheck@example.com' . "\r\n"; PHP: So you should use the \r\n after each header.
yes i am using exactly this script and copied from the site you mentioned i test it with *[*email]email[*/email*]and "\n"; double quotes and single quotes Code (markup): including MIME 1.0 and many additional headers every thing works only BCC header the script do not send to mail mentioned in BCC i am using example#4 script from php.net
<?php // multiple recipients $to = 'aidan@example.com' . ', '; // note the comma // subject $subject = $HTTP_POST_VARS['subject']; // message $message = ' <html> <head> <title>Birthday Reminders for August</title> </head> <body> <p>Here are the birthdays upcoming in August!</p> <table> <tr> <th>Person</th><th>Day</th><th>Month</th><th>Year</th> </tr> <tr> <td>Joe</td><td>3rd</td><td>August</td><td>1970</td> </tr> <tr> <td>Sally</td><td>17th</td><td>August</td><td>1973</td> </tr> </table> </body> </html> '; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'To: Mary <mary@example.com>, Kelly <kelly@example.com>' . "\r\n"; $headers .= 'From: Birthday Reminder <birthday@example.com>' . "\r\n"; $headers .= 'Cc: birthdayarchive@example.com' . "\r\n"; $headers .= 'Bcc: birthdaycheck@example.com' . "\r\n"; // Mail it //mail($to, $subject, $message, $headers); //remove "//" before mail PHP: also if i want to send more then one Bcc i need make new header for the next email address??