Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Member
    Join Date
    Jan 2006
    Location
    Mulund, India, India
    Posts
    118

    Default Problem with Mail_mime

    One of our customers is facing a problem in his code. It throws the error

    Fatal error: Class 'Mail_mime' not found in /home/yashagn/public_html/mail_try1.php on line 9

    Here is the code


    <?php
    error_reporting(E_ALL);
    ini_set('display_errors', '1');

    require_once 'Mail.php';
    require_once('/usr/local/lib/php/Mail/mimePart.php');

    $message = new Mail_mime();

    $text = 'Hello this is the Plain email';
    $html = '<b>Hello</b><hr />This is the HTML email.';

    $message->setTXTBody($text);
    $message->setHTMLBody($html);

    $body = $message->get();

    $extraheaders = array('From' => 'me@example.com',
    'Subject' => 'Subject');

    $headers = $message->headers($extraheaders);
    $mail = Mail::factory('mail');
    $mail->send('you@example.com', $headers, $body);
    ?>

    Can anybody tell me what is wrong in the code?
    Nitesh Shah

    Cheap Managed Dedicated Servers - http://www.qualispace.com/managed-servers/index.html

  2. #2
    Member
    Join Date
    Jan 2006
    Location
    Mulund, India, India
    Posts
    118

    Default

    I could resolve the issue myself. I added the line /usr/local/lib/php/Mail/mime.php just above /usr/local/lib/php/Mail/mimePart.php and that resolved the issue.
    Nitesh Shah

    Cheap Managed Dedicated Servers - http://www.qualispace.com/managed-servers/index.html

Similar Threads & Tags
Similar threads

  1. Pear Mail_mime installed but not available
    By RamiroS in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 03-12-2009, 09:59 AM
  2. DNSonly port 2087 problem. Very weird problem
    By web2corp in forum cPanel and WHM Discussions
    Replies: 9
    Last Post: 04-12-2007, 03:23 AM
  3. Cpanel/WHM problem, Exim problem, Mail problem
    By iroku in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 08-18-2006, 04:28 PM
  4. Email Sending Problem (451 Temporary local problem)
    By saj in forum E-mail Discussions
    Replies: 1
    Last Post: 03-30-2006, 10:07 AM
  5. FDF problem : Today I have problem when upgrade Apache
    By xmllist in forum cPanel Developers
    Replies: 0
    Last Post: 06-18-2004, 11:26 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube