Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- use PHPMailer\PHPMailer\PHPMailer;
- use PHPMailer\PHPMailer\Exception;
- //Load composer's autoloader
- require 'C:\wamp64\www\vendor\autoload.php';
- $mail= new PHPMailer(true);
- try
- {
- $mail->SMTPDebug=1;
- $mail->isSMTP();
- $mail->Host='smtp.gmail.com';
- $mail->SMTPAuth=true;
- $mail->Username='phptestmca2017@gmail.com';
- $mail->Password='lpupunjab123';
- $mail->SMTPSecure='ssl';
- $mail->Port='465';
- $mail->smtpConnect(
- array(
- "ssl"=>array(
- "verify_peer"=>false,
- "verify_peer_name"=>false,
- "allow_self_signed"=>true
- )
- )
- );
- //Recipients
- $mail->setFrom('phptestmca2017@gmail.com','MCA D1711 PHP');
- $mail->addAddress('kkaul928@gmail.com','Deepak Bhatta Kaji');
- $mail->addAttachment('E:\Zzzz Misc 2018\LOGO MIssion to LPU.png');
- $mail->addCC('gchirag09@gmail.com');
- $mail->addBCC('kkaul928@gmail.com');
- $mail->isHTML(true);
- $mail->Subject='Our Project Logo';
- $mail->Body='Hi Maam <br> This is our Game Logo <b>Mission To LPU</b>';
- $mail->AltBody='This is Body in Plain Text for Non-HTML MAil Clients';
- $mail->send();
- echo 'Message Has Been Sent';
- }
- catch(Exception $e)
- {
- echo 'Message Couldnot be Sent. Mailer Error:',$mail->ErrorInfo;
- }
- ?>
Add Comment
Please, Sign In to add comment