Can I send attachments to people who have opted to receive plain text emails (htmlemail = 0)?

I recently sent out a campaign with a PDF file attached. The only two recipients in the campaign who had turned off the receiving of HTML emails both got back to me to tell me the attachment was missing.

I did some testing and found out that phpList (using 3.5.6 with a pretty standard configuration) will not send attachments to plain texters. Rather it adds, all the way at the bottom of the email (so underneath my footer), a text like the following:

This message contains attachments that can be viewed with a webbrowser:

I don’t particularly like this for a couple of reasons:

  • Now my attachment is exposed to the web (albeit with a key in the URL, which is only safe if your site uses https) without me knowing it
  • It is unclear how long the download link will continue to work. It doesn’t seem to be forever, but this means that the recipients can’t review the attached information in the future.
  • Saying you don’t want HTML is not the same as saying that you don’t want attachments.
  • I have a 100% misunderstanding rate (N = 2, I know :wink: )

Does anybody know if there maybe is a configuration option that allows me to change this behaviour?

No there isn’t. The “text” format email is sent as non-mime. There isn’t a way to send a mime email with only a text part.

So long as you use a dedicated attachment directory instead of the default of the temp directory, then attachments should remain indefinitely.

1 Like

Thanks for the quick reply, and it makes sense now!

Now I also understand why the attachment no longer was available via the link (I hadn’t changed the default from /tmp).

So for anybody else having a similar problem, the option to add to your config.php and change is this one:

// the attachment repository is the place where the files are stored (if you use
// this needs to be writable to your webserver user
// it also needs to be a full path, not a relative one
// for secutiry reasons it is best if this directory is not public (ie below
// your website document root)
$attachment_repository = '/tmp';