Forum Moderators: coopster
Can any one give me smtp mail code with attachment, i am using a code but i will receiving the attachment as encrypted
// Add file attachment to the message
$msg .= "--{$mime_boundary}\n" .
"Content-Type: {$fileatt_type};\n" .
" name=\"{$fileatt_name}\"\n" .
//"Content-Disposition: attachment;\n" .
//" filename=\"{$fileatt_name}\"\n" .
"Content-Transfer-Encoding: base64\n\n" .
$data . "\n\n" .
"--{$mime_boundary}--\n";
}
am using the above give code and my header is
$headers = array ('From' => $from,'Subject' => $sub, 'Date' => date('r'), 'To'=>$to, 'cc'=>$cc, 'Bcc'=>$bcc,'MIME-Version'=> '1.0','Content-type'=> 'text/html; charset=iso-8859-1');
$smtp = Mail::factory('smtp',
array ('host' => $host,
'auth' => true,
'username' => $username,
'password' => $password));
$mail = $smtp->send($recipients, $headers, $msg);
please help me out..
thanks in advance .
-samu