Skip to main content
Inspiring
September 18, 2020
Answered

PHP Form With Attachments Tutorial

  • September 18, 2020
  • 2 replies
  • 497 views

I'm trying to find recent tutorials for building a contact form using PHP that also has the ability to include attached files like docx or pdf when the user submits the contact form.

 

Thanks in advance for any assistance.

This topic has been closed for replies.
Correct answer Nancy OShea

The PHPMailer library on GitHub can securely process mail with attachments and a good deal more.

https://github.com/PHPMailer/PHPMailer

 

Example Send File Upload

https://github.com/PHPMailer/PHPMailer/blob/master/examples/send_file_upload.phps

 

2 replies

Nancy OShea
Community Expert
Nancy OSheaCommunity ExpertCorrect answer
Community Expert
September 18, 2020

The PHPMailer library on GitHub can securely process mail with attachments and a good deal more.

https://github.com/PHPMailer/PHPMailer

 

Example Send File Upload

https://github.com/PHPMailer/PHPMailer/blob/master/examples/send_file_upload.phps

 

Nancy O'Shea— Product User & Community Expert
RR456Author
Inspiring
September 18, 2020

Thanks Nancy for the links. It's a great help.

Community Expert
September 18, 2020

Are you utilizing a database or do you want one that attaches to an email?

RR456Author
Inspiring
September 18, 2020

Hi Ben,

 

Thanks for the reply. No, I'm not utilizing a database in that the attachment would be dropped in, I assume, a folder on our server for us to get access to in some manner. Hope that makes sense.