aniketchandorkar

Untitled

May 30th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. <?php
  2. require 'PHPMailer/PHPMailerAutoload.php';
  3. require("PHPMailer/class.phpmailer.php");
  4. require("PHPMailer/class.smtp.php");
  5.  
  6. //create instance of phpmailer
  7. $mail = new PHPMailer();
  8.  
  9. $mail->Host = "smtp.gmail.com";
  10. $mail->SMTPAuth = true;
  11. $mail->Username = "cc.aniket@gmail.com";
  12. $mail->Password = "MYPASSWORD";
  13. $mail->SMTPSecure = "tls";
  14. $mail->Port = 587;
  15. $mail-> Subject = "Test";
  16. $mail-> Body = "Email body";
  17. $mail->setFrom('cc.aniket@gmail.com', 'Aniket Sender');
  18.  
  19. $mail->addAddress( 'aniket@parsel.in', 'Aniket');
  20. if (!$mail ->send()){
  21. echo "something wrong happened!";
  22. echo 'Mailer Error: ' . $mail->ErrorInfo;
  23. }else{
  24. echo "mail sent";
  25. }
  26. ?>
Add Comment
Please, Sign In to add comment