Advertisement
Guest User

Untitled

a guest
Jun 21st, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. $mailfrom = "EMAIL ADRES HIER"; // MOET HET GMAIL EMAILADRES ZIJN
  2. $mailfrompw = "EMAIL WACHTWOORD HIER" // MOET HET GMAIL EMAILADRES ZIJN
  3. $mailto = "VERZENDEN NAAR ADRES HIER";
  4. $subject = "ONDERWERP HIER";
  5.  
  6. $body='Een nieuwe interface-error op poortid: '.$key.', het aantal treshholds van '.$treshholds.' is overschreven.'; //voorbeeld bericht
  7.  
  8. date_default_timezone_set('Europe/Amsterdam');
  9.  
  10. require '../phpmailer/PHPMailerAutoload.php'; //zorg dat dit het goede path is naar jou phpmailer bestanden
  11.  
  12. $mail = new PHPMailer;
  13. $mail->isSMTP();
  14. $mail->SMTPDebug = 0;
  15. $mail->Debugoutput = 'html';
  16. $mail->Host = 'smtp.gmail.com';
  17. $mail->Port = 587;
  18. $mail->SMTPSecure = 'tls';
  19. $mail->SMTPAuth = true;
  20. $mail->Username = $mailfrom;
  21. $mail->Password = $mailfrompw;
  22. $mail->setFrom($mailfrom, '');
  23. $mail->addReplyTo($mailfrom, '');
  24. $mail->addAddress($mailto, '');
  25. $mail->Subject = $subject;
  26. $mail->msgHTML($body);
  27. $mail->AltBody = 'This is a plain-text message body';
  28.  
  29. if (!$mail->send()) {
  30. echo "Mailer Error: " . $mail->ErrorInfo;
  31. } else {
  32. echo "Message sent!";
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement