Mail Problem

hi guys…
i am using php to send mail with 4 attachements from my local Computer… and everything is working fine…

but when i saved the mail in database the attachements will not be saved… so

1- how to save attachment in my database… to let the user send the saved mail with its attachment (like saving draft in outlook, hotmail…)

also

2- i want to know how i can make the user browse his server while pressing on “browse” to send the file that exists on server as attachement coz the files are uploaded in it’s server.

any help please

  1. I would recomend saving the attachments in a separate directory on the server and storing the path to the attachment in the database.

  2. I wouldn’t recommend letting users browse actual directories on the server. Imho a better option is to present them with a form in the browser listing all their uploaded attachments. The listing could include a small button/icon that when clicked opens up the attachment in their browser or a new window for them to preview it.

also i have another idea… i can save file name of the file uploadded in database and select this file form the folder uploaded in… and then send it in my mail as attachemnt

example:
filename1.pdf “send as attachement”
filename2.jpg “send as attachement”

so when i choose the files using checkboxes i can send them… but i dont know how to send a file that exits on server as attachement in my mail without browsing???/

also i have another idea… i can save file name of the file uploadded in database and select this file form the folder uploaded in… and then send it in my mail as attachemnt

example:
filename1.pdf “send as attachement”
filename2.jpg “send as attachement”

so when i choose the files using checkboxes i can send them… but i dont know how to send a file that exits on server as attachement in my mail without browsing???/

yes, that is very similar to what I would do.

to send file attachments that are already uploaded into a directory on the server, this tutorial shows how to send

1 - plain text emails

2 - html emails

3 - emails with attachments

using php mail()