Advertisement
Guest User

Untitled

a guest
May 12th, 2016
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. require 'phpmailer/PHPMailerAutoload.php';
  2.  
  3. $mail = new PHPMailer;
  4.  
  5. $mail->isSMTP(); // Set mailer to use SMTP
  6. $mail->Host = 'mail.michelvaartjes.nl'; // Specify main and backup SMTP servers
  7. $mail->SMTPAuth = true; // Enable SMTP authentication
  8. $mail->Username = 'test@michelvaartjes.nl'; // SMTP username
  9. $mail->Password = 'test'; // SMTP password
  10. $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
  11. $mail->Port = 587; // TCP port to connect to
  12.  
  13. $mail->setFrom('from@example.com', 'Mailer');
  14. $mail->addAddress('meneervaartjes@hotmail.com', 'Joe User'); // Add a recipient
  15. $mail->addAddress('test@michelvaartjes.nl', 'Joe User');
  16. $mail->addReplyTo('info@example.com', 'Information');
  17.  
  18. $mail->isHTML(true); // Set email format to HTML
  19.  
  20. $mail->Subject = 'Here is the subject';
  21. $mail->Body = 'This is the HTML message body <b>in bold!asdasass</b>';
  22. $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
  23.  
  24. if(!$mail->send()) {
  25. echo 'Message could not be sent.';
  26. echo 'Mailer Error: ' . $mail->ErrorInfo;
  27. } else {
  28. echo 'Message has been sent aasdsadasaas';
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement