|
Posted by Manfred Kooistra on 01/13/07 15:08
Thank you, Rik.
Alas, that wasn't it.
I found out that the problem was trying to attach the file after
fopening and freading it. On debug, I got an error message telling me:
"File is not readable." I was wondering about that, because that files
permissions and path are alright. So I simply attached it without
fopening it - and that did the trick!
Not working:
$handle = fopen($uploaded_file_path, 'r');
$file = fread($handle, filesize($uploaded_file_path));
$mime->addAttachment($file, "image/$typ", $uploaded_file_name);
fclose($handle);
Working:
$mime->addAttachment($uploaded_file_path, "image/$typ",
$uploaded_file_name);
(with $typ preg_match/substr-ed from the file name)
I wonder about this, because I found hundreds of
mail-attachment-examples with fopen/fread, but I'm happy that my script
is running and I get mailed the uploaded files.
Thank you to all of you!
[Back to original message]
|