Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //php_mailer verwenden
- require 'src/Exception.php';
- require 'src/PHPMailer.php';
- require 'src/SMTP.php';
- use PHPMailer\PHPMailer\PHPMailer;
- use PHPMailer\PHPMailer\Exception;
- $mail = new PHPMailer(true); // Passing `true` enables exceptions
- try {
- //Server settings
- $mail->SMTPDebug = 0; // Enable verbose debug output
- $mail->isSMTP(); // Set mailer to use SMTP
- $mail->Host = 'smtp.web.de'; // Specify main and backup SMTP servers
- $mail->SMTPAuth = true; // Enable SMTP authentication
- $mail->Username = 'emailadresse'; // SMTP username
- $mail->Password = 'passwort'; // SMTP password
- $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
- $mail->Port = 587; // TCP port to connect to
- //Recipients
- $mail->setFrom('emailadresse');
- $mail->addAddress($email); // Add a recipient
- //Content
- $mail->isHTML(true); // Set email format to HTML
- $mail->Subject = 'Registrierung bei xxxx';
- $mail->Body = 'Vielen Dank für Ihre Anmeldung auf xxxx. </br>
- Ihre Daten werden zurzeit geprüft. </br>
- Sie erhalten weitere Informationen in den nächsten Tagen. </br>
- Mit freundlichen Gtüßen xxx xxx';
- $mail->AltBody = 'Vielen Dank für Ihre Anmeldung auf xxx. \n
- Ihre Daten werden zurzeit geprüft. \n
- Sie erhalten weitere Informationen in den nächsten Tagen. \n
- Mit freundlichen Gtüßen xxx xx';
- $mail->send();
- echo '<h1> Die Registrierung wurde versandt und wird in nächster Zeit geprüft.</h1> </br>
- <b> Kehren Sie zur <a href="http://xxxx">Startseite</a> zurück.';
- } catch (Exception $e) {
- echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo ,'</br>
- Bitte kontaktieren Sie xxx. ';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement