PHPMailer

Da ihr mir ja doch zum Mailer geraten habt, hier mein Script:
[PHP]<?php
require ‚PHPMailerAutoload.php‘;

$mail = new PHPMailer;

$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = ‚rex26.flatbooster.com‘; // Specify main and backup server
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = ‚web123456789123456789‘; // SMTP username
$mail->Password = ‚123456789abcdefghijklmnop‘; // SMTP password
$mail->SMTPSecure = ‚tls‘; // Enable encryption, ‚ssl‘ also accepted

$mail->From = ‚noreply@meinedomain.com‘;
$mail->FromName = ‚Mailer‘;
$mail->addAddress(‚jake@styler.de‘); // Add a recipient

$mail->WordWrap = 50; // Set word wrap to 50 characters
$mail->isHTML(true); // Set email format to HTML

$mail->Subject = ‚Here is the subject‘;
$mail->Body = ‚This is the HTML message body in bold!‘;
$mail->AltBody = ‚This is the body in plain text for non-HTML mail clients‘;

if(!$mail->send()) {
echo ‚Message could not be sent.‘;
echo 'Mailer Error: ’ . $mail->ErrorInfo;
exit;
}

echo ‚Message has been sent‘;

?>[/PHP]

Keine PHP Fehler, es gibt die Ausgabe „Message has been sent“ - Aber ich bekomme keine Mail :frowning:

Ich mache sicher etwas gehörig falsch, aber was? :slight_smile:

Danke!

Hast du es auf einen live Server getestet? Oder wo?

Lg

Jap, auf einem Liveserver, Mail-Server funktioniert auch.

Also ich hab bei mir nur die class.phpmailer.php, hast du mal probiert diese einzubinden?

Funktioniert leider auch nicht, gleiche Symptome wie oben genannt :S

Ähm, wo kommt denn die PHPMailerAutoload.php her? Die habe ich überhaupt nicht. Eigentlich braucht man die class.phpmailer.php, class.smtp.php und noch language/phpmailer.lang-de.php

Schreibe mal an den Anfang des Scriptes diese Zeilen:
[php]
error_reporting(E_ALL);
ini_set(„display_errors“, true);
[/php]

Keine PHP Fehler, die Autoload kommt aus dem aktuellen GitHub-Fork. Bin etwas verzweifelt :S

Das funktioniert bei mir einwandfrei:
[php]

<?php require 'includes/class.phpmailer.php'; $mail = new PHPMailer; $mail->PluginDir = "./includes/"; $mail->setLanguage("de"); $mail->isSMTP(); $mail->SMTPAuth = true; $mail->Host = 'mail.server.de'; $mail->Username = 'ich@server.de'; $mail->Password = 'xxxxxx'; $mail->From = 'name@server.de'; $mail->FromName = 'bdt600'; $mail->addAddress('meine@email.de'); $mail->WordWrap = 50; $mail->isHTML(true); $mail->Subject = 'Here is the subject'; $mail->Body = 'This is the HTML message body in bold!'; $mail->AltBody = 'This is the body in plain text for non-HTML mail clients'; if(!$mail->send()) { echo 'Message could not be sent.'; echo 'Mailer Error: ' . $mail->ErrorInfo; exit; } echo 'Message has been sent'; ?>

[/php]
Und das mitdem PHPMailer 5.2.4 von http://code.google.com/a/apache-extras.org/p/phpmailer/

:frowning:
[PHP]

<?php error_reporting(E_ALL); ini_set("display_errors", true); require 'class.phpmailer.php'; $mail = new PHPMailer; $mail->setLanguage("de"); $mail->isSMTP(); $mail->SMTPAuth = true; $mail->Host = 'xxx.com'; $mail->Username = 'xxx'; $mail->Password = 'xxx'; $mail->From = 'noreply@xxx.de'; $mail->FromName = 'xxx Support'; $mail->addAddress('xxx@live.de'); $mail->WordWrap = 50; $mail->isHTML(true); $mail->Subject = 'Here is the subject'; $mail->Body = 'This is the HTML message body in bold!'; $mail->AltBody = 'This is the body in plain text for non-HTML mail clients'; if(!$mail->send()) { echo 'Message could not be sent.'; echo 'Mailer Error: ' . $mail->ErrorInfo; exit; } echo 'Message has been sent'; ?>

[/PHP]

Class liegt im gleichen Ordner. Nichts.

Hmm, du nimmst als SMTP-Server nicht rein zufällig googlemail, oder?

Nö, direkt von meinem Hoster (flatbooster)

Hast du die Möglichkeit, über einen anderen Mailserver zu versenden? Also z.B. gmx, arcor oder sonstwas? Ich befürchte, dein Hoster ist das Problem.

Wie gesagt, es steht immer gesendet da, wird aber nicht gesendet… Kann dass vielleicht auch am Port liegen?

Ich probiers mal über nen anderen Hoster…

Und wieder nichts:
[PHP]<?php error_reporting(E_ALL); ini_set("display_errors", true); require 'class.phpmailer.php'; $mail = new PHPMailer; $mail->setLanguage("de"); $mail->isSMTP(); $mail->SMTPAuth = true; $mail->Host = 'smtp.web.de'; $mail->Username = 'lalobjac@web.de'; $mail->Password = 'xxx'; $mail->From = 'lalobjac@web.de'; $mail->FromName = 'xxx Support'; $mail->addAddress('xxx'); $mail->WordWrap = 50; $mail->isHTML(true); $mail->Subject = 'Here is the subject'; $mail->Body = 'This is the HTML message body in bold!'; $mail->AltBody = 'This is the body in plain text for non-HTML mail clients'; if(!$mail->send()) { echo 'Message could not be sent.'; echo 'Mailer Error: ' . $mail->ErrorInfo; exit; } echo 'Message has been sent'; ?>[/PHP]

Es heisst weiterhin: Message has been sent…

Bei web.de musst du damit arbeiten:

Postausgang:
Server: smtp.web.de
Port: 587
Verschlüsselung: STARTTLS

Immernoch nichts. Wie gebe ich den Port an?

[PHP]<?php
error_reporting(E_ALL);

require ‚PHPMailerAutoload.php‘;

$mail = new PHPMailer;

$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = ‚smtp.web.de‘; // Specify main and backup server
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = ‚lalobjac@web.de‘; // SMTP username
$mail->Password = ‚**********‘; // SMTP password
$mail->SMTPSecure = ‚STARTTLS‘; // Enable encryption, ‚ssl‘ also accepted

$mail->From = ‚lalobjac@web.de‘;
$mail->FromName = ‚Mailer‘;
$mail->addAddress(‚jake@styler.de‘); // Add a recipient

$mail->WordWrap = 50; // Set word wrap to 50 characters
$mail->isHTML(true); // Set email format to HTML

$mail->Subject = ‚Here is the subject‘;
$mail->Body = ‚This is the HTML message body in bold!‘;
$mail->AltBody = ‚This is the body in plain text for non-HTML mail clients‘;

if(!$mail->send()) {
echo ‚Message could not be sent.‘;
echo 'Mailer Error: ’ . $mail->ErrorInfo;
exit;
}

echo ‚Message has been sent‘;

?>[/PHP]

Ausgabe wie immer, wurde angeblich gesendet, kommt aber nichts.

Was hindert dich daran, die Doku oder die Beispiele vom PHPMailer zu beachten? Siehe z.B. http://phpmailer.worxware.com/index.php?pg=examplebsmtp