Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 259
  • Last Modified:

PHP mail() with attachments

I want to put a form on a site that users can email me and also send one attachment file (just PDF) if they want!
is anyone able to help?
0
edm19
Asked:
edm19
  • 6
  • 5
  • 2
1 Solution
 
pcaylorCommented:
There are two parts to doing this.  The first is getting the PDF file uploaded to somewhere you have access to and the second is sending yourself a MIME email.

I can walk you through rolling it yourself, but you'd probably get what you want easier by using the PHPFormmail script.  The author's page is in French, but once you download the code, it's pretty clear what is going on.

All you should have to do from there is put on a validator on your form to verify that the file is a PDF and you are ready to go.

http://www.hotscripts.com/Detailed/8397.html

-Peter
0
 
VGRCommented:
I like your "The author's page is in French, but " :D :D

Just to say that I'm also French an dthat I also posted at least two times a complete set of functions to send emails with multiple attachments :D
0
 
edm19Author Commented:
I am testing the PHPFormmail, has pcaylor sugested but if anything goes wrong,
VGR, where can I find that set of funtions?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
edm19Author Commented:
I am testing the PHPFormmail, has pcaylor sugested but if anything goes wrong,
VGR, where can I find that set of funtions?
0
 
edm19Author Commented:
I just put some changes, and it worked just fine. Thanks
0
 
VGRCommented:
ok, then grade "A" please 8-)
0
 
VGRCommented:
which changes ???
0
 
edm19Author Commented:
Nothing special! It was adapted to be used with a form.

- A function for testing email
- There is the chance for the user to sent the form without any attachment and also there is a limitation related to the attachments extentions that are alowed to be sent. For that I also created diferent messages/solutions to be sent for the user and the receiver of the form fields.

Thats it!
0
 
pcaylorCommented:
VGR,

The comment about French wasn't meant as an insult, just that not everyone here reads French.  (I can't but enough years of Latin helps me to get the gist of it.)

-Peter
0
 
VGRCommented:
I know it wasn't insulting 8-)
It was not 8-)
Being French is more a Gift from God than a shame :D
0
 
edm19Author Commented:
Nothing special! It was adapted to be used with a form.

- A function for testing email
- There is the chance for the user to sent the form without any attachment and also there is a limitation related to the attachments extentions that are alowed to be sent. For that I also created diferent messages/solutions to be sent for the user and the receiver of the form fields.

Thats it!
0
 
VGRCommented:
which extensions, please ? So that I update my code 8-)
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 6
  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now