mime mail problem with attachment
| From: | Brice Joly | Date: | Sun, 02 Mar 2003 17:16:21 +0000 |
| Subject: | mime mail problem with attachment | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-4017@lists.php.net to get a copy of this message | ||
I'm using Mail_Mime to send server-generated .pdf files to our site's
customers
Tests run fine on localhost (WinXP, Apache, PHP 4.3.0, latest Mail_Mime &
dependances version), mail is sent correctly and attachment works like a
charm.
It's another story on the server though (Debian), where any attempt to
attach a file failed : the file is actually spat in plain text into the mail
body (though encoding & file type are correct). Boundary is here too.
I tried with the documentation exemple (the one here
http://pear.php.net/manual/en/core.mail.mime.php)
and same problem. If I
comment the line
$mime->addAttachment($file, 'text/plain');
the mail works fine.
Problem occurs with and without HTML body.
Here's how the mail looks with the doc exemple:
boundary="=_49e104800fc634401b02e38d998143b4"
--=_49e104800fc634401b02e38d998143b4
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 7bit
Text version of email
--=_49e104800fc634401b02e38d998143b4
Content-Type: text/plain
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="destroy.php"
PD9waHAKICAgIHNlc3Npb25fc3RhcnQoKTsKCiAgICBzZXNzaW9uX2Rlc3Ryb3koKTsKPz4KPGhl
YWQ+CjxsaW5rIHJlbD0ic3R5bGVzaGVldCIgdHlwZT0idGV4dC9jc3MiIGhyZWY9ImFzdHJv
YWQ+dGhl
bWUuY3NzIj4KPC9oZWFkPgo8Ym9keT4KPHRhYmxlIHdpZHRoPSI0MCUiIHN0eWxlPSJ0ZXh0LWFs
aWduOiBjZW50ZXIiPgogIDx0cj48dGQgc3R5bGU9ImxpbmUtaGVpZ2h0OiAxNiI+Jm5ic3A7
aWduOiBjZW50ZXIiPgogIDx0cj48dGQgc3R5bGU9ImxpbmUtaGVpZ2h0OiAxNiI+PC90
ZD48L3RyPgogIDx0cj48dGQgc3R5bGU9InRleHQtYWxpZ246IGNlbnRlcjsgZm9udDogMTRweDsg
Ym9yZGVyOiBzb2xpZCAxcHggIzAwMDAwMDsgbGluZS1oZWlnaHQ6IDIuNSI+XzotOj0gU0VT
Ym9yZGVyOiBzb2xpZCAxcHggIzAwMDAwMDsgbGluZS1oZWlnaHQ6IDIuNSI+U0lP
TiBERVRSVUlURSA9Oi06XzwvdGQ+PC90cj4KICA8dHI+PHRkIHN0eWxlPSJ0ZXh0LWFsaWdu
TiBERVRSVUlURSA9Oi06XzwvdGQ+PC90cj4KICA8dHI+OiBj
ZW50ZXI7IGZvbnQ6IDEwcHgiPihGb25jdGlvbiBkZSBk6XZlbG9wcGVtZW50KTwvdGQ+PC90
ZW50ZXI7IGZvbnQ6IDEwcHgiPihGb25jdGlvbiBkZSBk6XZlbG9wcGVtZW50KTwvdGQ+cj4K
ICA8dHI+PHRkIGNsYXNzPSJtZW51VGl0cmUiIHN0eWxlPSJ0ZXh0LWFsaWduOiBjZW50ZXI7
ICA8dHI+IGZv
bnQ6IDEwcHgiPjxhIGhyZWY9Ijw/cGhwIHByaW50ICdpbmRleC5waHA/bGFuZz0nIC4gJF9HRVRb
J2xhbmcnXSA/PiI+UmV0b3VyIGF1IHNpdGUgYXZlYyB1bmUgbm91dmVsbGUgc2Vzc2lvbjwvYT48
L3RkPjwvdHI+CjwvdGFibGU+CjwvYm9keT4=
--=_49e104800fc634401b02e38d998143b4--
The server admin has tried a raw sendmail test on his server and it worked
fine with attachment and all
Any suggestion welcome
Thanks
Brice