This gives us a simple interface for attaching a file to the email object.
When it comes time to send the email through smtp_send()
, all attachments
(specified by individual calls to add_attachment()
) will be faithfully
transmitted along with the message.
add_attachment( email, file, content_type = mime::guess_type(file), filename = basename(file) )
The email message object, as created by the |
|
file | The filename for the file to be attached. |
content_type | The MIME type for the attachment. By default, this is
guessed by the |
filename | the filename for the attachment. This can be different than
the basename provided to |
There are options available to specify the attachment's MIME type, its disposition, and customize the attachment's recipient-facing filename.