After spending some time wading through the various debates about HTML Mail/Mail System/SMTP vs. MimeMail, PHPMailer, etc., I prefer the architecture and vision of HTML Mail. Your approach seems more object-oriented, flexible and maintainable. However, I'm having trouble figuring out how to add a file attachment to an email in cases where the attachment is something other than an image embedded in the email.

Your document states that embedded images will be automatically converted into MIME attachments. However, I want to add a PDF document as an attachment to accompany the text of the message. My use case is a job application website where applicants are asked to upload their resumes, which are then emailed to potential employers. Can you explain how to do this?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pillarsdotnet’s picture

Component: Documentation » Code
Assigned: Unassigned » pillarsdotnet
Category: support » feature

Noted.

You could do this with MailMIME but it certainly could be easier. Will try to work this into the rewrite.

See #1333310: Rewrite and fork PEAR classes instead of subclassing.

neochief’s picture

Status: Active » Needs review
FileSize
1.48 KB

Here's the patch for attachements. Tested with webform attachments, works like a charm.

hansfn’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

I'm the Views Send developer and I have requests for adding support for HTML Mail. To my surprise HTML Mail didn't support attachments. After some searching I found this issue with a patch from 2012 - that still works perfectly! Please commit.

Probably other people need further support for attachments, but this is a nice good start.

Oleksiy’s picture

Thanks for the patch. It works! Would be great to see it committed.

  • salvis committed 863c933 on 7.x-2.x
    Issue #1341772 by neochief: File attachments.
    
salvis’s picture

Status: Reviewed & tested by the community » Fixed

Ok, thank you neochief, hansfn, and Oleksiy!

Status: Fixed » Closed (fixed)

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

thomasmurphy’s picture

I've downloaded the dev version which has this patch applied to it, thanks.

It doesn't seem like it creates any additional UI, how does it work? I'm trying to attach a file to an email where the file URL is available as a rules variable.

pribeh’s picture

Bumping @thomasmurphy's request. Anybody have any tips?

salvis’s picture

Please open a new support request.