I created a real simple test webform with two fields only.
- Name:
- Email:

When an anonymous visitor submit the form, a white page appears with the following error:

Fatal error: Call to undefined function mimemail() in /omitted-path-here/sites/all/modules/webform/webform.module on line 2225

My setup:

Drupal 7

HTML Mail
7.x-1.x-dev

Mime Mail
7.x-1.x-dev Se

Mime Mail Action
7.x-1.x-dev

Mime Mail CSS Compressor
7.x-1.x-dev

Webform
7.x-3.6

Thanks!

Comments

design.er’s picture

I have the same error with Mime Mail installed.

quicksketch’s picture

Mimemail has changed it's API in Drupal 7 and the mimemail() function no longer exists, I've requested that the documentation be updated at http://drupal.org/node/939208#comment-4016590, right now I'm not really sure how to update the code.

quicksketch’s picture

Status: Active » Postponed (maintainer needs more info)
StatusFileSize
new3.52 KB
new3.29 KB

I've been trying to get MIME Mail working with Webform again in Drupal 7 but it seems that at this point, MIME Mail is not ready for production use. First, there's an issue with attachments that prevents them from being sent at all (see #1066438: Initial support of attachments). But besides this, I can't figure out how to make MIME Mail actually send HTML e-mails at all. Attached are two attempts at getting MIME Mail working, but neither sends e-mails correctly.

Approach 1 attempts to use MIME Mail's mimemail_html_body() to structure an e-mail and then use the Default mailing system. Approach 2 attempts to switch Webform to use MIME Mail's mailing system but not encode the e-mail ourselves. Combining the approaches results in an even worse result so I didn't include that here.

Basically right now we either need to wait for MIME Mail to stabilize or get some help from the maintainers on how we're supposed to implement the APIs, right now it doesn't seem ready for use.

To be clear, neither of these patches actually work or are suitable for use. For the time being I'd recommend disabling MIME Mail module.

quicksketch’s picture

StatusFileSize
new3.37 KB

I've committed this placeholder patch to at least identify the fact that Webform and MIME Mail currently do not cooperate together. I don't want to hold up a new D7 release for this bug. This will make it so that having both modules installed will not cause a problem, but if you try to send HTML or Attachments with Webform and MIME Mail, e-mails will come through either empty or incorrectly. Help text identifies the fact that these features do not yet work.

quicksketch’s picture

Title: Fatal error: Call to undefined function mimemail() ... webform.module on line 2225 » Include attachments and HTML e-mail options not working (MIME Mail integration)
sgabe’s picture

Component: User interface » Code
Category: bug » support
Status: Postponed (maintainer needs more info) » Needs work
StatusFileSize
new3.75 KB

Hi Nathan! I did not dig through your patches, but I took a look at them, and it seems to me that you approach the problem from the wrong direction. I think it's much more simple than that. I hope that the attached patch helps.

quicksketch’s picture

Category: support » bug

Thanks sgabe for the patch. It won't be usable directly since Webform has "per-email" configuration of whether to use MIME Mail or the default mail system, not a global setting. I know that Drupal core can set a mail system per mail-key, but considering webform can generate thousands of mail keys on a site, using the normal "mail_system" variable approach won't work for us.

The patch looks similar to my attempt in #2, but hopefully it will provide enough new direction that I can figure it out from here.

geefin’s picture

Receiving the same error (500 errror Premature end of script headers: index.php) on

Webform 6.x-3.5
Mimemail alpha6

Tried disabling sitewide Mimemail and then sending Webform as plaintext but error still occured.

Only solution to get a webform to submit was to completely turn off mimemail :(

pjcdawkins’s picture

Subscribe

jtwalters’s picture

subscribe

kimlop’s picture

subscribe

joostvdl’s picture

subscribe

Proj’s picture

subscribe

droath’s picture

subscribe

glefebvre’s picture

subscribe

ngstigator’s picture

subscribe

star-szr’s picture

Subscribe

JamFar’s picture

+1. Subscribing

quicksketch’s picture

Status: Needs work » Fixed
StatusFileSize
new5.67 KB
new3.41 KB

I looked again at sgabe's patch in #6 and realized I completely misunderstood the "mail_system" variable (as would many people I expect). The variable contains a key to make it so that a particular $mail_key is handled by a particular mail system. Since Webform uses "webform" for all its mail key for all e-mails, that's really all we need.

I did however tweak sgabe's patch because I find it silly that users would be required to manually select MIME Mail if it was available. If it's available, we should use it no matter what since it handles both plain text and HTML e-mails, both with or without attachments. There's no reason why we'd require the user to make such a decision.

As such, I've abstracted this system slightly through a new wrapper function webform_email_html_capable(). In the event that any other mail handlers become available, we can support those too and we're not necessarily locked into MIME Mail alone (though I don't see any indication that MIME Mail wouldn't work for all situations). In any case, it provides us a nice location for manually setting the mail system variable so the end-user never has to worry about it.

I've tested and committed these patches on both branches. Thanks sgabe for your excellent help, I just wish I would have understood it!

Status: Fixed » Closed (fixed)

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

aks_richa’s picture

i have created my site in drupal 6 and i have used webform modules also used mime mail modules, i want to add attachment in all out going mail from site. i want to add an option at admin side, 4 PDF attachment at admin side . is there any modules available, so i can add it. so i can get option at admin side to attach PDF for all out going mail.