Forum Moderators: coopster

Message Too Old, No Replies

smtp attachment using pear.php

help me out in smtp attachment

         

sham1321

5:27 am on Aug 28, 2008 (gmt 0)

10+ Year Member



Hai!

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

PHP_Chimp

11:17 am on Aug 28, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



When you say encrypted I assume you mean as base64, or is the attachment encrypted by a different means?

sham1321

7:25 am on Aug 29, 2008 (gmt 0)

10+ Year Member



hai php_chimp

ya its base64