Advertisement
Guest User

mailer.php

a guest
Jul 22nd, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.83 KB | None | 0 0
  1.  
  2.            
  3.             <?php                  
  4.                     require('C:\xampp\htdocs\PHPMailer\class.phpmailer.php');                                          
  5.                     $mail = new PHPMailer();
  6.                     $mail->IsSMTP();
  7.                     $mail->SMTPAuth = true;
  8.                     $mail->SMTPSecure ="ssl";
  9.                     $mail->SMTPDebug = 1;
  10.                     $mail->Host ="smtp.gmail.com";
  11.                     $mail->Port = 465;
  12.  
  13.                     $mail->Username ="arduinoonly@gmail.com";//sender username
  14.                     $mail->Password ="arduino123";//sender password
  15.  
  16.                     $mail->IsHTML(true);
  17.                     $mail->From =$mail->Username;
  18.                     $mail->FromName ="Arduino Only";
  19.                     $mail->addAddress("simpplvespa@gmail.com");
  20.                     $mail->WordWrap=50;
  21.  
  22.                     $mail->Subject = "Arduino";
  23.                     $mail->Body = "Motion Detected!";
  24.  
  25.                     if(!$mail->Send()){
  26.                         echo "Message Not sent!";
  27.                         echo 'Mailer error: ' .$mail->ErrorInfo;
  28.                     }else{
  29.                         echo "Message sent!";
  30.                     }
  31.                    
  32.             ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement