Just a note here that with PHP 5.3, Mail Mime works flawlessly for me. (sidenote: I didn't download the include module and don't have PEAR but it seems to work great. I do have Phar installed and mbstring.http_output_conv_mimetypes which is new to 5.3 I believe)
However on a PHP 5.2.17 with the include module, the module does it's job however with an html-capable email client, it not only shows the html message immediately but also includes every linked image as an attached image.
I'd like to be able to not have the attachments show up at all if the email can be rendered as html. Is it possible?
cheers
-wil
Comment | File | Size | Author |
---|---|---|---|
#11 | PEAR_Mail_mime-change_base64_to_8bit-1174882-11.patch | 500 bytes | pillarsdotnet |
#6 | PEAR_Mail_mime-change_inline_to_attachment-1174882-6.patch | 514 bytes | pillarsdotnet |
#3 | test-email-received.png | 69.37 KB | pillarsdotnet |
Comments
Comment #1
pillarsdotnet CreditAttribution: pillarsdotnet commentedThanks for the report; I will investigate.
Comment #2
pillarsdotnet CreditAttribution: pillarsdotnet commentedBuilding php 5.2.17 from source now...
Need to downgrade my copy of flex....
Okay, now running php 5.2.17.
Testing....
Comment #3
pillarsdotnet CreditAttribution: pillarsdotnet commentedSymptoms don't repeat on php 5.2.17 receiving via Mozilla Thunderbird. I see no image attachments.
Comment #4
blasthaus CreditAttribution: blasthaus commentedMaybe it's an issue with Gmail then. I'll run a test on Litmus and report back
Comment #5
blasthaus CreditAttribution: blasthaus commentedEDIT: Actually the below applies to sending attached images which do not also appear in the body (Gmail only) sorry!
For GMail, I read that in order for this not to occur, need to change several things in Mime:
1. The first Content-Type must be "Content-Type: multipart/related;"
2. The image attachments must not have "Content-Disposition: inline"
fyi: here is the Litmus test http://blasthaus.litmus.com/pub/8326852 which doesn't actually show the attachments to the messages, but I'm getting them on GMail on a Mac
Comment #6
pillarsdotnet CreditAttribution: pillarsdotnet commentedEDIT: Your litmus link sends me to a page full of broken images; each one leads to a 404 error page.
In order to have text and html alternatives, inline images, and attachments in the same email, the MIME structure must be as follows:
So making the first part
multipart/related
would eliminate the possibility of anytext/plain
alternative or file attachments.As for the
Content-Disposition
attribute, there are only two possible values:'attachment'
and'inline'
.Are you saying that changing it from
'inline'
to'attachment'
will prevent it from showing up as an attachment? That seems rather counter-intuitive.If true, then the only way to fix it is to edit the
Mail/mime.php
file in your PEAR directory.Here's a patch that you can apply to that file.
Comment #7
pillarsdotnet CreditAttribution: pillarsdotnet commentedComment #8
blasthaus CreditAttribution: blasthaus commentedFirst off, note: my edit #5.
When setting Content-Type: multipart/alternative, yes this allows for plain text alternative and images (Content-Disposition set to inline or attachment). This seems to be the proper method if one is interested in base64 encoding images in the header.
For me, any images in the (text/html) are getting base64 encoded and tagged Content-Disposition: inline. While it's an interesting method, if you have a lot of images the email becomes weighty. In addition at least from my tests, Gmail displays them additionally as attachment (in some cases, not sure why but its true - this may have to do with a Received-SPF: softfail problem I'm having on one site that's still in development)
It seems to be a logical best practice to not send base64 encoded images within html emails this way
See http://www.campaignmonitor.com/blog/post/1759/embedding-images-revisited/
Is this the intended functionality of Mail Mime or should i suspect something else like mime.php
thanks once again!
Comment #9
blasthaus CreditAttribution: blasthaus commentedNot sure if this helps, but I've seen this declaration used in headers btw and images display inline, plain text version ok, (no inline images)
Comment #10
pillarsdotnet CreditAttribution: pillarsdotnet commentedPossible encodings are
7bit
,8bit
,base64
, andquoted-printable
. Many mail systems will reject or re-encode8bit
content as it doesn't comply with published RFC standards. Of the other possibilities, onlybase64
is appropriate to binary content. I suppose you could choosequoted-printable
but I'd be very surprised if this somehow makes your images start working.It looks like you want a way to turn off the embedding of linked images altogether. I will work on making this an option on the HTML Mail configuration page.
Comment #11
pillarsdotnet CreditAttribution: pillarsdotnet commentedAgain, changing from
base64
to8bit
requires an edit to the PEARMail/mime.php
file.Here is a patch; let me know if it solves your problem.
Comment #12
TR CreditAttribution: TR commented