Skip to main content

Posts

Showing posts from August, 2018

PHP Send email with attachments without saving files PHPMailer

Send email with attachments without saving files PHPMailer Keep follow the below steps to send email with multiple attachments without saving files on local using phpmailer :- 1) Create a project folder and navigate to our new project folder. 2)Install phpmailer by using below command   composer require phpmailer/phpmailer 3) Now create a index.php file with the below code <?php // Import PHPMailer classes into the global namespace // These must be at the top of your script, not inside a function use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; if(isset($_POST['submit'])) { //Load Composer's autoloader require 'vendor/autoload.php'; $mail = new PHPMailer(true);                              // Passing `true` enables exceptions try {         //Server settings     $mail->SMTPDebug = 2;                                 // Enable verbose debug output     $mail->isSMTP();                                      // Set maile