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