PHP mail function to send attachment to submitted address

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Wannabecoder
Forum Newbie
Posts: 1
Joined: Sat Jun 27, 2015 8:47 pm

PHP mail function to send attachment to submitted address

Post by Wannabecoder »

Hi,

Thank you for reading this post.

I am new to PHP so please excuse my lack of knowledge.

I have the following requirement and I was hoping someone would help with the code please.

I need HTML and PHP code that allows a user of the site to enter their email address select an attachment from a drop down list (files contained on the web server) and it will send the chosen file to the email address they have input.

I can't figure out how to make the mail function work with the above scenario.

Please note I need to do this without an SMTP server.

Thank you.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: PHP mail function to send attachment to submitted addres

Post by Celauran »

Wannabecoder wrote:Please note I need to do this without an SMTP server.
Not going to happen.

If the files already exist on the server, why bother with email? Why not just let the user download the file?
Post Reply