Problem: I send out an email (using phpmailer and sendmail) which has a complex html attachment. I don't want the email client to attempt to display the attachment, since it's far too complex to be viewed in a mail reader.
As far as I can make out, the way to do this is to set content-Disposition
to attachment
. The default in phpmailer is to set it to attachment
anyway. However, Thunderbird (the only client I've tested so far) does actually attempt to display the html. If I view the headers in Thunderbird, I can't see a Content-Disposition
, but if I save the mail I can see:
--b1_420d367a26870bbc3bae73fb1de31f49
Content-Type: application/octet-stream; name="chart.html"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="chart.html"
Thunderbird has given the attachment the correct name, so it presumably understands the Content-Disposition
. Is there something I can do with phpmailer to stop clients displaying html attachments, or can clients just do what they want?
Sending a compressed file isn't really an option - the users may not be sophisticated enough to know what to do with it.