PHP Classes

Get Errors

Recommend this page to a friend!

      Attachment Mailer class  >  All threads  >  Get Errors  >  (Un) Subscribe thread alerts  
Subject:Get Errors
Summary:Errors in mailer class and mailer example
Messages:3
Author:Muhammad Rizwan
Date:2007-03-01 04:14:22
Update:2008-06-19 14:29:37
 

  1. Get Errors   Reply   Report abuse  
Picture of Muhammad Rizwan Muhammad Rizwan - 2007-03-01 04:14:22
Hi,

I get 2 errors while using your code,
1) Call to undefined function: mime_content_type() in attach_mailer_class.php
2) Call to undefined function: del_temp_file() in upload_and_mail_example.php on line 26

Can you explain why these errors occur?

Thanks

  2. Re: Get Errors   Reply   Report abuse  
Picture of Olaf Lederer Olaf Lederer - 2007-03-01 05:52:53 - In reply to message 1 from Muhammad Rizwan
Please check the new version on my website and if you have further questions post them on the support forum (link is on my website and inside the (new) class file).

Olaf

  3. Re: Get Errors   Reply   Report abuse  
Picture of David Ferreira David Ferreira - 2008-06-19 14:29:37 - In reply to message 2 from Olaf Lederer
You can fix that deprecated function of mime_content_type, using this instead...

if (!function_exists('mime_content_type'))
{
function mime_content_type($file, $method = 0)
{
if ($method == 0)
{
ob_start();
system('/usr/bin/file -i -b ' . realpath($file));
$type = ob_get_clean();

$parts = explode(';', $type);

return trim($parts[0]);
}
else if ($method == 1)
{
// another method here
}
}
}