Edit report at http://bugs.php.net/bug.php?id=48826&edit=1

 ID:                 48826
 Comment by:         anrdaemon at freemail dot ru
 Reported by:        php at richardneill dot org
 Summary:            Add attachment support to mail()
 Status:             Open
 Type:               Feature/Change Request
 Package:            Mail related
 Operating System:   *
 PHP Version:        *
 Block user comment: N
 Private report:     N

 New Comment:

"Given the fact it is already overloaded", it is better to cleanup and
shape the code for a more robust and predictable functionality.

Not to bloat it unnecessarily.


Previous Comments:
------------------------------------------------------------------------
[2009-07-07 04:30:31] php at richardneill dot org

Description:
------------
It would be a really nice if mail() supported an extra parameter for 

attachments. Perhaps an array containing the filenames (and whose 

keys, if present, would be the name of the attachments).



(I know there are ways of doing this by installing pear classes, but 

that isn't always an option. And it's awkward to do it by hand).



Given that mail() is already rather overloaded, it might be worth 

adding another function, say mail_attach() to do it.





Reproduce code:
---------------
Current alternative:



$cmd = "echo '$BODY_TEXT'  | mutt -s '$SUBJECT' -a '$filename_1' -a
'$filename_2' '$email'";

exec ($cmd);



which is ugly, has external dependencies, only works on Linux, and will
break in interesting ways if shell-quoting isn't corrected.





------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=48826&edit=1

Reply via email to