Guest User

Untitled

a guest
Jun 19th, 2018
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. while ( $row = mysql_fetch_object($ergebnis) )
  2. {
  3.  
  4. $empfaenger = $row->UserMail;
  5. $betreff = $_POST["betreff"];
  6. $text = $_POST["nachricht"];
  7.  
  8.  
  9. $mail = new PHPMailer(true); //defaults to using php "mail()"; the true param means it will throw exceptions on errors, which we need to catch
  10. 04.
  11. 05.try {
  12. 06. $mail->AddReplyTo('promopool@commercial-bitches.de', 'Commercial Bitches');
  13. 07. $mail->AddAddress($empfänger);
  14. 08. $mail->SetFrom('promopool@commercial-bitches.de', 'Commercial Bitches');
  15. 09. $mail->AddReplyTo('promopool@commercial-bitches.de', 'Commercial Bitches');
  16. 10. $mail->Subject = $betreff;
  17. 11. $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
  18. 12. $mail->MsgHTML(file_get_contents('contents.html'));
  19. 15. $mail->Send();
  20. 16. echo "Message Sent OK\n";
  21. 17.} catch (phpmailerException $e) {
  22. 18. echo $e->errorMessage(); //Pretty error messages from PHPMailer
  23. 19.} catch (Exception $e) {
  24. 20. echo $e->getMessage(); //Boring error messages from anything else!
  25. 21.}
  26. ?>
Add Comment
Please, Sign In to add comment