Send Multiple Attachments In Email Using PHP
Tuesday, Jan 24, 2017
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.
SociallyViral is a beautifully designed WordPress theme that is built to be engaging, fast, and most importantly, boost viral traffic. With features to help increase social sharing, you'll get more traffic from the web's top social media websites and also boost your search engine rankings.. Click Here For More Details
To Send Multiple Attachments In Email It Takes Only One Step:-
- Make a PHP file to send mail with multiple attachments
Video is a WordPress theme that is built for blogs that have media such as videos. With a like/dislike feature, watch later feature, playlist, low bounce rate, integration with YouTube for view counts, and all the features you expect from MyThemeShop such as search engine optimization, you need Video for your site.. Click Here For More Details
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.