Advertisement
Guest User

Untitled

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