Forum Moderators: coopster

Message Too Old, No Replies

email attachments that are in the database

         

bomburmusicmallet

6:07 pm on Sep 16, 2007 (gmt 0)

10+ Year Member



Hi all,

I have documents in a database that I need to email. I have a script that works sending attachments, but only if the file *really* exists on the server. I have another script that pulls the file contents from the database for download, but obviously that does not create a *real* file on the server.

How would I do this? I've googled for a while and can't find this information.

TIA, Jenny

Dilly

10:09 pm on Sep 16, 2007 (gmt 0)

10+ Year Member



when you say documents is it a file saved on the database using blob?

bomburmusicmallet

11:28 pm on Sep 16, 2007 (gmt 0)

10+ Year Member



Yes, it's a blob, but I think I just figured it out. I think I need to retrieve the content into a variable and just process it the same way as I would a open a file and use its content.

Dilly

9:40 am on Sep 17, 2007 (gmt 0)

10+ Year Member



If it's just text then why have the file uploaded and not just the text content of the file to the mysql database?

bomburmusicmallet

11:54 am on Sep 17, 2007 (gmt 0)

10+ Year Member



It's not just text, they are word docs, pds or rich text docs. I was able to make them become attachments in my email, but now can't get the email to be an HTML email.

coopster

5:08 pm on Sep 17, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



The php mail function [php.net] page in the online manual has information on how to email with attachments and special types of content. The classic zend article link listed there is a great primer, too.