<?php $mailto = $_POST['mail_to']; $mailSub = $_POST['mail_sub']; $mailMsg = $_POST['mail_msg']; require 'lib/vendor/phpmailer/phpmailer'; $mail = new PHPMailer(); $mail ->IsSmtp(); $mail ->SMTPDebug = 0; $mail ->SMTPAuth = true; $mail ->SMTPSecure = 'ssl'; $mail ->Host = "smtp.gmail.com"; $mail ->Port = 465; // or 587 $mail ->IsHTML(true); $mail ->Username = "acc.ldevera@gmail.com"; $mail ->Password = "accountsamplepassword"; $mail ->SetFrom("acc.sample@gmail.com"); $mail ->Subject = $mailSub; $mail ->Body = $mailMsg; $mail ->AddAddress($mailto); $mail->AddAttachment('pdf_files/reservation.pdf', 'reservation.pdf'); if(!$mail->Send()) { echo "Mail Not Sent"; } else { echo "Mail Sent"; } ?>
require 'lib/vendor/phpmailer/phpmailer'; // it's a path to phpmailer package. <pre> once you have the same 'path' to your file 'phpmailer' , all emails will be sent.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)