Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $mailfrom = "EMAIL ADRES HIER"; // MOET HET GMAIL EMAILADRES ZIJN
- $mailfrompw = "EMAIL WACHTWOORD HIER" // MOET HET GMAIL EMAILADRES ZIJN
- $mailto = "VERZENDEN NAAR ADRES HIER";
- $subject = "ONDERWERP HIER";
- $body='Een nieuwe interface-error op poortid: '.$key.', het aantal treshholds van '.$treshholds.' is overschreven.'; //voorbeeld bericht
- date_default_timezone_set('Europe/Amsterdam');
- require '../phpmailer/PHPMailerAutoload.php'; //zorg dat dit het goede path is naar jou phpmailer bestanden
- $mail = new PHPMailer;
- $mail->isSMTP();
- $mail->SMTPDebug = 0;
- $mail->Debugoutput = 'html';
- $mail->Host = 'smtp.gmail.com';
- $mail->Port = 587;
- $mail->SMTPSecure = 'tls';
- $mail->SMTPAuth = true;
- $mail->Username = $mailfrom;
- $mail->Password = $mailfrompw;
- $mail->setFrom($mailfrom, '');
- $mail->addReplyTo($mailfrom, '');
- $mail->addAddress($mailto, '');
- $mail->Subject = $subject;
- $mail->msgHTML($body);
- $mail->AltBody = 'This is a plain-text message body';
- if (!$mail->send()) {
- echo "Mailer Error: " . $mail->ErrorInfo;
- } else {
- echo "Message sent!";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement