• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

PHPMailer

jakestyler

Mitglied
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 = '[email protected]';
$mail->FromName = 'Mailer';
$mail->addAddress('[email protected]');  // 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 <b>in bold!</b>';
$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';

?>

Keine PHP Fehler, es gibt die Ausgabe "Message has been sent" - Aber ich bekomme keine Mail :(

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

Danke!
 
Ä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);
 
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 = '[email protected]';
  $mail->Password = 'xxxxxx';
  $mail->From = '[email protected]';
  $mail->FromName = 'bdt600';
  $mail->addAddress('[email protected]');

  $mail->WordWrap = 50;
  $mail->isHTML(true);
  $mail->Subject = 'Here is the subject';
  $mail->Body  = 'This is the HTML message body <b>in bold!</b>';
  $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';
?>
Und das mitdem PHPMailer 5.2.4 von http://code.google.com/a/apache-extras.org/p/phpmailer/
 
:(
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 = '[email protected]';
  $mail->FromName = 'xxx Support';
  $mail->addAddress('[email protected]');

  $mail->WordWrap = 50;
  $mail->isHTML(true);
  $mail->Subject = 'Here is the subject';
  $mail->Body  = 'This is the HTML message body <b>in bold!</b>';
  $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';
?>

Class liegt im gleichen Ordner. Nichts.
 
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.
 
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 = '[email protected]';
  $mail->Password = 'xxx';
  $mail->From = '[email protected]';
  $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 <b>in bold!</b>';
  $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';
?>

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 = '[email protected]';                            // SMTP username
$mail->Password = '**********';                           // SMTP password
$mail->SMTPSecure = 'STARTTLS';                            // Enable encryption, 'ssl' also accepted

$mail->From = '[email protected]';
$mail->FromName = 'Mailer';
$mail->addAddress('[email protected]');  // 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 <b>in bold!</b>';
$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';

?>

Ausgabe wie immer, wurde angeblich gesendet, kommt aber nichts.
 
Zurück
Oben