Send Email multiple file attachment using PHP – Email is very useful thing for every web project. Every web project need an email system for sending notifications or information to the users. Many times we needs to send email with text or html content and attachment files.

In this tutorial we will discuss how to send email with single or multiple attachments in PHP. Our tutorial will help web developers to send text or html email including any types of files as an attachment (like images, .doc, .docx, .pdf, .txt, etc.). We have been made the whole process are very simple and easy. Please follow the short and easy tutorial given below. Also you can view the live demo from the above “Demo” link and download the full source code with step by step instruction from the above “Download” link.

send email multiple file attachment using php

Send Email multiple file attachment using PHP

At first we will create a function named multi_attach_mail(). This function required some arguments, like receiver email, email subject, email message, sender email, sender name and attachment files array. Please see the source code given below and follow the comment lines for better understanding.

Use the Function and Send Email:

Declare some variables, like receiver email, email subject, email message, sender email, and sender name. $to variable is used for hold the receiver email id, $from variable is used for hold the sender email id, $from_name variable is used for hold the sender name, $attachment_files variable is used for hold the attachment files path array, $subject variable is used for hold the email subject, $html_content variable is used for hold the email body content.

You only need to change two variables value. Firstly change the $to variable value with the receiver email id and secondly change the $attachment_files value with the attachment files path array. Now call the previously created function and pass the variables as the function arguments. Please see the source code given below and follow the comment line.

Full Source code

If you have any query about this tutorials, please feel free to contact admin@vetbossel.in or you can post your valuable comments at the below comment form. We are always happy to hear from you.

Click to download
Click to download