I have followed the procedure for creating customized emails to be sent after submitting a webform (created the appropriate webform-mail-[ID].tpl.php) and for the most part everything works. Here is the issue with the attachment

If I do not select the "Send e-mail as HTML" and DO click "Include files as attachments," the attachment goes through fine, however in the customized email the html tags are visible. This, of course, is actually working properly.

However, If you select the "Send e-mail as HTML" and also "Include files as attachments" the email goes through, looks great all styled up, BUT the attachment does not get attached to the email.

Comments

jmerandy’s picture

Title: Webform Customized HTML Email: Attachment not being delivered with » Webform Customized HTML Email: Attachment not being delivered
jmerandy’s picture

Is this a MIME issue? or is it an issue of Webform and MIME not playing nicely together??

quicksketch’s picture

Status: Active » Fixed

It's a Webform issue. It should already be fixed as part of #1162112: Mime Mail error after upgrade Webform. The next release of Webform (3.12) will include the fix. In the mean time you can download the 3.x dev release by clicking "View all releases" from the project page.

jmerandy’s picture

Issue tags: +MIME mail

First, thanks quicksketch for all your work on the Webform and responses to so many questions over the years. Amazing really!

I just want to post an update to this issue and its resolution because it is very likely that others could benefit.

There were three separate issues actually in the end:

Issue 1: There was an issue related to the upgrades for Webform, which was quickly resolved with a quick revert to the Webform 3.x dev release. However the error message that many were receiving #1162112: Mime Mail error after upgrade Webform, was only part of the problem...

Issue 2: Even with the fix on the Webform end, another issue persisted. At the bottom of my customized HTML email messages, I was receiving a small snippet of code which pertained to the subject line in the default email message. Here is the line which was appearing...

">
New Banner Service Request Submitted (this was my customized subject line)

I went through every bit of code in my customized HTML message and found no errors. I went through the Webform module document looking at every instance of "subject" and found no issues. Finally in examining the HTML source code of my email against the MIME mail module code ( I was using the latest version 6.x-1.0-beta1), I found that the code in the mimemail-message.tpl.php which surrounds the customized message was breaking on line 31 body id="mimemail-body" class="mail-
the closing tag was, as you can see from the snippet being produced at the end of my customized email, not actually closing. Discovering this, I reverted back one version to mimemail 6.x-1.0-alpha8 and ran update.php. When the problem persisted, I went back another version to mimemail 6.x-1.0-alpha7 and ran the update.php again; the problem disappeared. I actually then upgraded to 6.x-1.0-alpha8 (trying to isolate the version issue) and that version actually worked, the problem seemed to be in version 6.x-1.0-beta1. I don't know how to relate this issue to the Drupal community since the comments only allow you to post to one project.....

Issue 3: The attachment not being delivered. I did a lot of testing on this. Finally, I found that when I forwarded the customized email from my recipient account, which was an outlook based email system, to an alternate email account (a Gmail account for instance), the attachment would appear. I then changed the recipient account completely to the Gmail and there were no problems with the attachment either. So, it turns out that the issue was not with MIME mail nor was it with Webform. It was the settings on my University's Outlook exchange server. By default, it was set to not accept attachments of the MIME mail variety. I only introduce this here, even though it was not a Drupal issue in the end, because it seems very likely this will be an issue for other users and perhaps they wont have to pull their hair out looking through every nook and cranny of Drupal only to find out that the issue was never in Drupal at all!

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.

YesCT’s picture

Is there an issue or documentation ... I see in the issue 'If I do not select the "Send e-mail as HTML" and DO click "Include files as attachments," the attachment goes through fine' but I can't get that far. Do I need to ... "created the appropriate webform-mail-[ID].tpl.php"?