Form mailer with attachments.

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
cupaball
Forum Commoner
Posts: 85
Joined: Sun Feb 12, 2006 1:46 pm

Form mailer with attachments.

Post by cupaball »

I would think that this is fairly simple; however I cannot find a solution.

I already have a form that sends the contents to my email and adds to a database.

Can someone point me in the right direction as to how to add an attachment feature?
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

PHP Mailer or Swiftmailer are both libraries that will allow you to do so.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Form mailer with attachments.

Post by Christopher »

cupaball wrote:Can someone point me in the right direction as to how to add an attachment feature?
I'm not sure you want to go that direction. Producing compliant MIME emails is what might be considered non-trivial -- and certainly non-fun. Those excellent packages mentioned are the result of many, many bug reports and tedious coding.
(#10850)
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Form mailer with attachments.

Post by Chris Corbyn »

arborint wrote:Those excellent packages mentioned are the result of many, many bug reports and tedious coding.
Indeed... it's like HTML and web browsers; If all email clients and servers followed standards it would be straightforward. Initially there were quite a few (relatively minor) bugs to iron out but everything has hit a stable point now...

That said, I'll kid nobody, MIME as a basic concept is extremely simple once you've looked at a few examples.
Post Reply