View Single Post
Old 05-21-2010, 01:29 AM   #2 (permalink)
delayedinsanity
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

My first suggestion would be to avoid recreating the wheel. There are libraries out there that make this stupid simple, such as PHPMailer.

That aside, if it's for learning purposes, if you have plans to make this available for your web site, I would work heavily on doing some form validation. You're using unvalidated unfiltered values which opens you WIDE up to a variety of attacks. Don't forgo security in favor of speed to complete an application, ever.

You are going to want to look up php file handling, in particular, the $_FILES superglobal that automatically populates with information from a forms file input field. The next thing you are going to want to research is the proper mail headers to attach a file, as the basic headers you are sending above won't permit this.
delayedinsanity is offline  
Reply With Quote