Advertisement
Guest User

Untitled

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