I am writing a php application, and one part of the requirement is to mail a pdf file to someone.
I downloaded a script to use as my mail server needs smtp authentication etc.
Whilst the script DOES generate an email as expected, the actual email has loads of random rubbish in the body.
I changed the mime type to application/pdf but still I get loads of rubbish and no actual attachment.
I have shown the code from my script - can someone please fix it for me?
$text = 'Text version of email';
$html = '<html><body>HTML version of email</body></html>';
$file = './quote.pdf';
$crlf = "rn";
$hdrs = array(
'From' => 'email@example.com',
'To' => 'firstname.lastname@example.org',
'Subject' => 'Your Quotation'
$params = array(
'host' => "ssl://mail.xxx.co.uk",
'port' => "465",
'username' => "xxx",
'password' => "xxx"
$mime = new Mail_mime($crlf);
$body = $mime->get();
$hdrs = $mime->headers($hdrs);
$mail =& Mail::factory('smtp', $params);
$mail->send('email@example.com', $hdrs, $body);