Installed the newest version of Mail Mime and Include. Error occurs when I try to send a test email from /admin/config/system/htmlmail/test. The result is no mail is sent. Tried reinstalling modules, checked that I have the PEAR Modules installed and that the include path is correct.

Fatal error: Call to undefined method Mail_mimePart::encodeHeader() in C:\xampp\htdocs\drupal\sites\all\modules\mailmime\mailmime.inc on line 779

Comments

pillarsdotnet’s picture

Assigned: Unassigned » pillarsdotnet
Status: Active » Closed (won't fix)

The Mail_mimePart::encodeHeader() function was introduced in version 1.6.1, released in 2006. If your copy lacks this function, it is over five years old and should be updated.

See duplicate issue:

#1130890: Fatal error: Call to undefined method Mail_mimePart::encodeHeader() in mailmime.inc on line 784

I'm tempted to mark this "wont-fix" because I'm just not interested in supporting PEAR libraries over five years old.

However, if you come up with a patch that offers backwards-portability without sacrificing functionality, I'd be happy to review and commit it.

pillarsdotnet’s picture

Status: Closed (won't fix) » Postponed (maintainer needs more info)

Added note to README and on project page.

I'd be interested in feedback if you have any.

travelertt’s picture

Yup, that was the problem. I'm using XAMPP 1.7.4, I assumed that it would be using the newest version of PEAR and Mail_Mime. Upgraded both and it's working perfectly. Is there any way that this module can do a version check on Mail_Mime during install? That would be a good feature enhancement, but I don't know if Drupal can do that or not. Thanks for the quick response!

pillarsdotnet’s picture

Title: Fatal error: Call to undefined method Mail_mimePart::encodeHeader() » Check for existence of Mail_mimePart::encodeHeader() in mailmime_check_requirements().
Status: Postponed (maintainer needs more info) » Needs work

It's easier to check for the function existence than the version number, which is stored differently depending on whether you downloaded via SVN or the pear command-line tool.

Added a check for method_exists('Mail_mimePart', 'encodeHeader') in mailmime_check_requirements().

Such checks really belong in mailmime_requirements() but I've had to invent work-arounds because neither Drupal core nor Libraries API support PEAR libraries.

Hmm... Something is wrong with drupal.org -- it won't let me create a 7.x-2.12 release.

pillarsdotnet’s picture

Status: Needs work » Postponed
pillarsdotnet’s picture

Version: 7.x-2.11 » 7.x-2.13
Status: Postponed » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.