Hi,
what is the BCC code and where will i place it?
i tried placing a BCC code in my Mail.php page which is included in my blast.php page but i am getting some parse error unexpected T_STRING message.
sorry, i am still a newbie and i just got all my codes from another forum and he never came back to me again about my questions.
below is my code for Mail.php
<?php
class Mail
{
function Mail()
{
// $this->headers = "From: CompanionSeek <Admin@localhost.com>";
$this->headers = "From: JobHiRings<postmaster@jobhirings.com>";
$this->headers .= "\n"BCC: $to\"";
$this->footers = "\n\n\n--- Please Do Not Reply To This Message --- \n\nBest Regards,\nThe JobHiRings Team";
}
function SendMail($to,$subject,$msg)
{
$subject = stripslashes($subject);
$msg = stripslashes($msg);
$to = stripslashes($to);
if(MAIL_ACTIVE)mail("pixeltrace@gmail.com", $subject, $msg.$this->footers, $this->headers);
}
// $file_list: array("File","File_Name","File_MIME_Type")
function SendAttachment($to,$subject,$msg,$file_list)
{
$subject = stripslashes($subject);
$msg = stripslashes($msg);
$bcc = stripslashes($bcc);
$m_file = $file_list['File'];
$file_name = $file_list['Name'];
$file_mime_type = $file_list['Mime'];
$file_ext = $file_list['Extension'];
// Read the file to be attached ('rb' = read binary)
$file = fopen($m_file,'rb');
$data = fread($file,filesize($m_file));
fclose($file);
// Generate a boundary string
$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
$this->headers .= "\nMIME-Version: 1.0\nContent-Type: multipart/mixed; boundary=\"{$mime_boundary}\"";
$this->headers .= "\n"BCC: $to\"";
$msg =
"This is a multi-part message in MIME format.\n\n--{$mime_boundary}\n" .
"Content-Type: text/plain; charset=\"iso-8859-1\"\n" .
"Content-Transfer-Encoding: 7bit\n\n" .
$msg . "\n\n";
$data = chunk_split(base64_encode($data));
$msg .=
"--{$mime_boundary}\n" .
"Content-Type: {$file_mime_type}; name=\"{$file_name}.{$file_ext}\"\n" .
"Content-Disposition: attachment\n" .
"Content-Transfer-Encoding: base64\n\n" .
$data . "\n\n" .
"--{$mime_boundary}--\n";
if(MAIL_ACTIVE)mail("pixeltrace@gmail.com", $subject, $msg.$this->footers, $this->headers);
}
function SendHTML($to,$subject,$msg){
$mime_boundary = uniqid("HTMLMESSAGE");
$this->headers .= "\nMIME-Version: 1.0\nContent-Type: multipart/alternative; boundary=\"{$mime_boundary}\"";
$this->headers .= "\n"BCC: $to\"";
//plain text version of message
//HTML version of message
$data = chunk_split(base64_encode($msg));
$msg =
"--{$mime_boundary}\r\n" .
"Content-Type: text/html; charset=ISO-8859-1\r\n" .
"Content-Transfer-Encoding: base64\r\n\r\n".
$data. "\n\n" .
"--{$mime_boundary}--\n";
mail("pixeltrace@gmail.com", $subject, $msg, $this->headers);
}
function SendAttachment2($to,$subject,$msg,$m_file)
{
$subject = stripslashes($subject);
$msg = stripslashes($msg);
$to = stripslashes($to);
$fileatt = $m_file['tmp_name'];
$fileatt_type = $m_file['type'];
$fileatt_name = $m_file['name'];
if (is_uploaded_file($fileatt)) {
// Read the file to be attached ('rb' = read binary)
$file = fopen($fileatt,'rb');
//$data = fread($file,filesize($fileatt));
$data = fread($file,filesize($fileatt));
fclose($file);
echo $fileatt_type;
// Generate a boundary string
$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
$this->headers .= "\nMIME-Version: 1.0\nContent-Type: multipart/mixed; boundary=\"{$mime_boundary}\"";
$this->headers .= "\n"BCC: $to\"";
$msg =
"This is a multi-part message in MIME format.\n\n--{$mime_boundary}\n" .
"Content-Type: text/plain; charset=\"iso-8859-1\"\n" .
"Content-Transfer-Encoding: 7bit\n\n" .
$msg . "\n\n";
$data = chunk_split(base64_encode($data));
$msg .=
"--{$mime_boundary}\n" .
"Content-Type: {$fileatt_type}; name=\"{$fileatt_name}\"\n" .
"Content-Disposition: attachment\n" .
"Content-Transfer-Encoding: base64\n\n" .
$data . "\n\n" .
"--{$mime_boundary}--\n";
}
if(MAIL_ACTIVE)mail("pixeltrace@gmail.com", $subject, $msg.$this->footers, $this->headers);
}
function SetHeader($val){
$this->headers = 'From: '.$val;
$this->headers .= "\n"BCC: $to\"";
}
function SetFooter($val){
$this->footers = "\n\n\n$val";
}
}
?>
hope you could help me with this.
thanks!