PHP mail() Bcc problem
Posted: Thu Oct 12, 2006 5:04 am
Hi all,
Am facing this problem from last 2 days, but am not able to decide where the problem is.
I have small problem when sending mails as Bcc.
Here is my code,please help how to solve this issue.
Now my problem is , when i tried to send mail, the Bcc mail id's are coming along with the message.
The mail is not going for the mailid which is in Bcc.
I think am clear with my problem.
Waiting for your valuable replies...............
Thanks and regards
MADHU
Am facing this problem from last 2 days, but am not able to decide where the problem is.
I have small problem when sending mails as Bcc.
Here is my code,please help how to solve this issue.
Code: Select all
[b]<?
// toid , bccpath(uploaded file path) , subject and message i will request from text field
if(isset($_REQUEST['toid']) && isset($_REQUEST['bccpath']) && isset($_REQUEST['subject']) && isset($_REQUEST['message']))
{
if(isset($_REQUEST['toid'])) $toid=$_REQUEST['toid']; //toid
if(isset($_REQUEST['bccpath'])) $bccpath=$_REQUEST['bccpath']; //bccpath
if(isset($_REQUEST['subject'])) $subject=$_REQUEST['subject']; //sub
if(isset($_REQUEST['message'])) $message=$_REQUEST['message']; //msg
// i created a folder named as 'bcc' in the server . bcc folder contains some text files , text file contains the mailid's which i have to send as Bcc.
if(!(is_dir('bcc')))
@mkdir('bcc');
@chmod('bcc', 0777);
$temp = "bcc/" . $_FILES['bccpath']['name'];
@move_uploaded_file($_FILES['bccpath']['tmp_name'], $temp);
@chmod($temp, 0777);
$filename = "bcc/" . $_FILES['bccpath']['name'];
$fp=fopen($filename,"rb");
$bccemails=file($filename);
foreach($bccemails as $bccemail)
{
$headers.= "$bccemail" . ", ";
}
$header = "Bcc: $headers\r\n";
mail($toid , $subject, $message, $header);
}
?>[/b]The mail is not going for the mailid which is in Bcc.
I think am clear with my problem.
Waiting for your valuable replies...............
Thanks and regards
MADHU