Advertisement
Guest User

Untitled

a guest
Apr 3rd, 2018
513
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.14 KB | None | 0 0
  1. require("C:/xampp/htdocs/api/vendor/phpmailer/phpmailer/src/PHPMailer.php");
  2. require("C:/xampp/htdocs/api/vendor/phpmailer/phpmailer/src/SMTP.php");
  3. require("C:/xampp/htdocs/api/vendor/phpmailer/phpmailer/src/Exception.php");
  4.  
  5. $mail = new PHPMailer\PHPMailer\PHPMailer(); // Passing `true` enables exceptions
  6. try {
  7. //Server settings
  8. $mail->SMTPDebug = 3; // Enable verbose debug output
  9. $mail->isSMTP(); // Set mailer to use SMTP
  10. $mail->Host = 'mail.privateemail.com'; // Specify main and backup SMTP servers
  11. $mail->SMTPAuth = true; // Enable SMTP authentication
  12. $mail->Username = 'support@hypnos.network'; // SMTP username
  13. $mail->Password = 'support321!mail'; // SMTP password
  14. $mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted
  15. $mail->Port = 465; // TCP port to connect to
  16. $mail->SMTPOptions = array(
  17. 'ssl' => array(
  18. 'verify_peer' => false,
  19. 'verify_peer_name' => false,
  20. 'allow_self_signed' => true
  21. )
  22. );
  23. //Recipients
  24. $mail->setFrom('support@hypnos.network');
  25. $mail->addAddress('akshaycm@hotmail.com'); // Name is optional
  26.  
  27. //Content
  28. $mail->isHTML(true); // Set email format to HTML
  29. $mail->Subject = 'Hypnos ICO Email Verification';
  30. $mail->Body = 'Thank you for registering for our ICO,please click this link to verify your account';
  31. $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
  32.  
  33. $mail->send();
  34. echo 'Message has been sent';
  35. } catch (Exception $e) {
  36. echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement