Having enabled both mimemail and smtp modules, I got this error (and a blank page in my browser...):

PHP Fatal error: Cannot redeclare drupal_mail_wrapper() (previously declared in /var/www/drupal5/sites/all/modules/mimemail/mimemail.module:249) in /var/www/drupal5/sites/all/modules/smtp/smtp.module on line 247

The only way to sort out of the trouble was to disable smtp module :-(

Comments

allie micka’s picture

Project: Mime Mail » SMTP Authentication Support

Technically, this problem lies in the other module(s). Mimemail will only declare that function if the following is true:

- You have checked the setting to use Mime mail for all of your messages
- No other module has already declared this function.

However, since mime mail's code runs before SMTP's code, the function gets defined, and since the SMTP module doesn't do any checking, you get this error. You can probably correct this behavior by disabling the "use for all messages" setting in mime mail.

Mime mail was written to support alternative mail engine backends. If the SMTP author were willing to implement a smtp_mailengine() hook then you can use both modules in harmony.

jacauc’s picture

...also had this problem. Subscribing

djbeppe’s picture

I have this problem too

psi-borg’s picture

ditto.

disabling the "use for all messages" setting in mime mail did fix it... however, im not sure why you have checkboxes for 2 mutually exclusive functions or why you would always want 1 or the other anyway.

now that im done beotching, thanks for the great work.

paul_gregory’s picture

Is there still no fix for this issue? Anyone looking in to it?

nschindler’s picture

Same problem since upgrading to Drupal 5.4. This "mime mail" you speak of isn't installed on my system.

oadaeh’s picture

Title: Cannot redeclare drupal_mail_wrapper() » Mime Mail intergration: Cannot redeclare drupal_mail_wrapper()

Organizing the issue queue.

open-keywords’s picture

Shouldn't this be pushed to the smtp module ?

I had
Fatal error: Cannot redeclare drupal_mail_wrapper() (previously declared in /xxxxx/drupal/sites/all/modules/smtp/smtp.module:163) in /xxxxx/drupal/sites/all/modules/devel/devel.module on line 1336

when switching the log behavior to Log only

oadaeh’s picture

Status: Active » Fixed

Code submitted here: http://drupal.org/cvs?commit=121743

If there are problems, create a new issue.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

muhithg’s picture

Hia! I'm a Uni student & trying to use Drupal for my disso/project. A newbie...a child at drupal so wud need great amount of help.
Can anyone help me please. I get that similar message but the only difference is that i'm running Drupal 6.9 (updated recently) on Windows on my laptop along with WAMP so everything is on localhost.

Error is:
Fatal error: Cannot redeclare drupal_mail_wrapper() (previously declared in
C:\wamp\www\Diabetes_FYP\sites\all\modules\smtp\phpmailer\phpmailer.module:36)
in
C:\wamp\www\Diabetes_FYP\sites\all\modules\smtp\smtp.module on line 675

I checked up where i ws going wrong and have some idea how to sort it BUT it only tells me info of what to do after i log back in...My problem is HOW DO I GET OUT OF THIS WHITE BLANK PAGE WITH THE FATAL ERROR MESSAGE TO MY NORMAL (LOGIN) SCREEN SO THAT I CAN DISABLE THAT PHPMAILER?

System restore wouldn't work.

Please get back to me asap. You can e-mail me on muhithmg@aston.ac.uk

Thank you very much
MD G Muhith

oadaeh’s picture

@muhithg: the Drupal 6.x compatible version of SMTP Auth. Support has not been updated to include support for the MIME Mail module. I've been swamped w/non-Drupal things for a few months, but I'll try to get the support in there as soon as I can.

richard.jensen’s picture

Honestly, this situation is ridiculous on too many levels to count.

So, I'm a new Drupal user, although I'm no stranger to large PHP apps. I'm baffled by this whole email situation and the attendant "white screens of death."

First we have this whole WSOD issue to begin with. I won't even go there now, as that's a topic of its own. But... come on! Drupal is in its 7th major release, and we still have THIS to contend with???

But, on to the real topic....

Primarily we have these conflicting low-level mail code bits that make the mail subsystem "work." Webmail Pro seems to be the only game in town for Drupal 6.x, but it requires several alpha modules, like phpmailer (which seems to be a major part of the problem), and "mail api," which appears to be incompatible with "imap-wu api," which seems to be needed to make any kind of imap connection via webmail pro.

On my site what I've got now is a confused combination of various pieces of mail functionality which don't work together without error, yet all of which webmail pro claims to need in order to function at all. Like nschindler above, I don't even have "mime mailer" installed on my system. So where is this error coming from?

Can somebody recommend a non-webmail pro email client that handles secure imap and secure smtp without the need for these conflicting, alpha release, and ridiculously buggy modules?

The email situation in Drupal 6.x is pathetic from what I can see; and there's got to be a better way than webmail pro with all of its conflicting alpha bits.

I'm frustrated beyond belief. If it weren't for the other positives (that I can't find anywhere else) with Drupal, I'd dump this whole sorry mess.

Drupal seems fast and great until you actually start adding necessary functionality to it. Then it quickly falls apart in the least graceful fashion I've ever seen in a cms. Joomla, by contrast, is a real pain to configure and maintain, but at least it's very stable and handles errors gracefully. So, I've got to choose between pains.

Again, is there another 6.x compatible webmail client for Drupal, or is there a fix for this particular error?

ysanchez’s picture

muhithg, a simple tip to resolve your problem, (worked for me).
Rename the mime and smtp module folders. Go into the smtp settings and put it non active. Then you can rename the folders again to their original names and uninstall the modules if you want.

entertaintulsa’s picture

Version: 5.x-1.x-dev » 6.x-1.x-dev

I have this issue in trying to set my site up to send mail and followed all the install instructions for SMTP module and the phpmailer so disabled the smtp module and tried mimemail and have no access to site to disable mimimail as the default mail sender to get access to the admin pages to try anything else. I have no access to my site due to the only screen that will come up is a white page with this error:

Fatal error: Cannot redeclare drupal_mail_wrapper() (previously declared in D:\hosting\member\entertaintul\leslimize\sites\all\modules\mimemail\mimemail.module:261) in D:\hosting\member\entertaintul\leslimize\sites\all\modules\smtp\smtp.module on line 675
PHP Fatal error: Cannot redeclare drupal_mail_wrapper() (previously declared in D:\hosting\member\entertaintul\leslimize\sites\all\modules\mimemail\mimemail.module:261) in D:\hosting\member\entertaintul\leslimize\sites\all\modules\smtp\smtp.module on line 675