Advertisement
Guest User

Untitled

a guest
Dec 17th, 2017
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <?php
  3. require 'vendor/autoload.php';
  4.  
  5. $mail = new PHPMailer (true);
  6.  
  7. $mail->isSMTP();
  8. $mail->Host = 'smtp.gmail.com';
  9. $mail->SMTPAuth = true;
  10. $mail->Username = 'meine gmail adresse';
  11. $mail->Password = 'mein gmail passwort';
  12. $mail->SMTPSecure = 'ssl';
  13. $mail->Port = 465;
  14. $mail->CharSet = "UTF-8";
  15.  
  16. $mail->setFrom('meine gmail adresse', 'mein name');
  17. $mail->addReplyTo('meine gmail adresse', 'mein name');
  18.  
  19. $mail->addAddress('empfänger email adresse',);
  20. $mail->isHTML(true);
  21.  
  22. $mail->Subject = 'Here is the subject';
  23. $mail->Body = 'This is the HTML message body <b>in bold!</b>';
  24.  
  25. if(!$mail->send()) {
  26. echo 'Your message could not be sent. Please try again!';
  27. echo 'Mailer Error: ' .$mail->ErrorInfo;
  28. } else {
  29. echo 'Your Message has been sent! I will reply as quickly as i can ;)'
  30. }
  31. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement