In this tutorial we will show you how to send multiple attachments in email using PHP and
PHP Mailer Library.
In this we send multiple images in email from our directory you send any file as email attachment.
You may also like send beautiful emails using HTML and PHP.
To Send Multiple Attachments In Email It Takes Only One Step:-
- Make a PHP file to send mail with multiple attachments
Step 1. Make a PHP file to send mail with multiple attachments
We make a PHP file and save it with a name mail.php
<?php require_once('class.phpmailer.php'); $send_mail = new PHPMailer(); $send_mail->From =Sender Email; $send_mail->FromName = Name; $send_mail->Subject = Subject; $send_mail->Body = Message; $send_mail->AddAddress(Reciever Email); $attach_file1 = $folder."image1.jpg"; $attach_file2 = $folder."image2.jpg"; $attach_file3 = $folder."image3.jpg"; $send_mail->AddAttachment($attach_file1); $send_mail->AddAttachment($attach_file2); $send_mail->AddAttachment($attach_file3); $send_mail->Send(); ?>
In this step we add PHP Mailer Library and use PHPMailer object and then enter all the details and attach all the files we want to send as attachments in email.
We choose images from our directory to send in email as attachments you can use any type of files. You may also like verify account on signup through email using PHP.
Thats all, this is how to send multiple attachments in email using PHP. You can customize this code further as per your requirement. And please feel free to give comments on this tutorial.
Latest Tutorials
- Create Animated Skill Bar Using jQuery, HTML And CSS
- Simple And Best Responsive Web Design Using CSS Part 2
- Show Button On Hover Using HTML And CSS
- Material Design Login Form Using jQuery And CSS
- Animated Progress Bar Using jQuery And CSS
- Dynamic Drop Down Menu Using jQuery, Ajax, PHP And MySQL
- Get Website Statistics Using PHP, jQuery And MySQL
- HTML5 Login And Signup Form With Animation Using jQuery
- Facebook Style Homepage Design Using HTML And CSS
- View Webpage In Fullscreen Using jQuery