Ads-Mod, Fehler beim Aufruf

Allgemeiner Support zum phpBB 2 Board und phpBB 2 Modifikationen

Moderator: Moderatoren

Forumsregeln
Auch wenn hier der Support für phpBB 2 weiterhin aufrecht erhalten bleibt, weisen wir darauf hin, dass das phpBB 2 nicht mehr offiziell unterstützt und weiterentwickelt wird!

Ads-Mod, Fehler beim Aufruf

Beitragvon Holger » Mi 06.Jun, 2012 16:12 • Beitrag als PDF

Hallo,

wenn ich bei mir die Ads-Seite aufrufe bekomme ich fast immer:
Failed sending email :: PHP ::

DEBUG MODE

Line : 246
File : emailer.php

Rufe ich danach die Seite auf, ist alles wieder normal.

Ich denke, dass entstand nach dem Upgrade vom PHP auf den neuesten Stand.
Wonach müsste ich mal schauen?

Zeile 246 ist die letzte message_die am Ende:
Code: Alles auswählen
   // Send the mail out to the recipients set previously in var $this->address
// +MOD : MegaMail
   function send($email_format = 'text')
// -MOD : MegaMail
   {
      global $board_config, $lang, $phpEx, $phpbb_root_path, $db;

       // Escape all quotes, else the eval will fail.
      $this->msg = str_replace ("'", "\'", $this->msg);
      $this->msg = preg_replace('#\{([a-z0-9\-_]*?)\}#is', "' . $\\1 . '", $this->msg);

      // Set vars
      reset ($this->vars);
      while (list($key, $val) = each($this->vars))
      {
         $$key = $val;
      }

      eval("\$this->msg = '$this->msg';");

      // Clear vars
      reset ($this->vars);
      while (list($key, $val) = each($this->vars))
      {
         unset($$key);
      }

      // We now try and pull a subject from the email body ... if it exists,
      // do this here because the subject may contain a variable
      $drop_header = '';
      $match = array();
      if (preg_match('#^(Subject:(.*?))$#m', $this->msg, $match))
      {
         $this->subject = (trim($match[2]) != '') ? trim($match[2]) : (($this->subject != '') ? $this->subject : 'No Subject');
         $drop_header .= '[\r\n]*?' . preg_quote($match[1], '#');
      }
      else
      {
         $this->subject = (($this->subject != '') ? $this->subject : 'No Subject');
      }

      if (preg_match('#^(Charset:(.*?))$#m', $this->msg, $match))
      {
         $this->encoding = (trim($match[2]) != '') ? trim($match[2]) : trim($lang['ENCODING']);
         $drop_header .= '[\r\n]*?' . preg_quote($match[1], '#');
      }
      else
      {
         $this->encoding = trim($lang['ENCODING']);
      }

      if ($drop_header != '')
      {
         $this->msg = trim(preg_replace('#' . $drop_header . '#s', '', $this->msg));
      }

      $to = $this->addresses['to'];

      $cc = (count($this->addresses['cc'])) ? implode(', ', $this->addresses['cc']) : '';
      $bcc = (count($this->addresses['bcc'])) ? implode(', ', $this->addresses['bcc']) : '';

// +MOD : MegaMail
      if ($email_format == 'html')
      {
         // Build html header
         $this->extra_headers = (($this->reply_to != '') ? "Reply-to: $this->reply_to\n" : '') . (($this->from != '') ? "From: $this->from\n" : "From: " . $board_config['board_email'] . "\n") . "Return-Path: " . $board_config['board_email'] . "\nMessage-ID: <" . md5(uniqid(time())) . "@" . $board_config['server_name'] . ">\nMIME-Version: 1.0\nContent-type: text/html; charset=" . $this->encoding . "\nContent-transfer-encoding: 8bit\nDate: " . date('r', time()) . "\nX-Priority: 3\nX-MSMail-Priority: Normal\nX-Mailer: PHP\nX-MimeOLE: Produced By phpBB2\n" . $this->extra_headers . (($cc != '') ? "Cc: $cc\n" : '')  . (($bcc != '') ? "Bcc: $bcc\n" : '');
      }
      else
      {
         // Build text header
         $this->extra_headers = (($this->reply_to != '') ? "Reply-to: $this->reply_to\n" : '') . (($this->from != '') ? "From: $this->from\n" : "From: " . $board_config['board_email'] . "\n") . "Return-Path: " . $board_config['board_email'] . "\nMessage-ID: <" . md5(uniqid(time())) . "@" . $board_config['server_name'] . ">\nMIME-Version: 1.0\nContent-type: text/plain; charset=" . $this->encoding . "\nContent-transfer-encoding: 8bit\nDate: " . date('r', time()) . "\nX-Priority: 3\nX-MSMail-Priority: Normal\nX-Mailer: PHP\nX-MimeOLE: Produced By phpBB2\n" . $this->extra_headers . (($cc != '') ? "Cc: $cc\n" : '')  . (($bcc != '') ? "Bcc: $bcc\n" : '');
      }
// -MOD : MegaMail

      // Send message ... removed $this->encode() from subject for time being
      if ( $this->use_smtp )
      {
         if ( !defined('SMTP_INCLUDED') )
         {
            include($phpbb_root_path . 'includes/smtp.' . $phpEx);
         }

         $result = smtpmail($to, $this->subject, $this->msg, $this->extra_headers);
      }
      else
      {
         $empty_to_header = ($to == '') ? TRUE : FALSE;
         $to = ($to == '') ? (($board_config['sendmail_fix']) ? ' ' : 'Undisclosed-recipients:;') : $to;

         $result = @mail($to, $this->subject, preg_replace("#(?<!\r)\n#s", "\n", $this->msg), $this->extra_headers);

         if (!$result && !$board_config['sendmail_fix'] && $empty_to_header)
         {
            $to = ' ';

            $sql = "UPDATE " . CONFIG_TABLE . "
               SET config_value = '1'
               WHERE config_name = 'sendmail_fix'";
            if (!$db->sql_query($sql))
            {
               message_die(GENERAL_ERROR, 'Unable to update config table', '', __LINE__, __FILE__, $sql);
            }

            $board_config['sendmail_fix'] = 1;
            $result = @mail($to, $this->subject, preg_replace("#(?<!\r)\n#s", "\n", $this->msg), $this->extra_headers);
         }
      }

      // Did it work?
      if (!$result)
      {
         message_die(GENERAL_ERROR, 'Failed sending email :: ' . (($this->use_smtp) ? 'SMTP' : 'PHP') . ' :: ' . $result, '', __LINE__, __FILE__);
      }

      return true;
   }
Real men don’t back up, they learn data recovery. ;-)
http://www.mysqldumper.de
http://www.mysqldumper.se
Holger
User
User
 
Beiträge: 2253
Registriert: Mi 17.Mär, 2004 19:09

Re: Ads-Mod, Fehler beim Aufruf

Beitragvon oxpus » Mi 06.Jun, 2012 20:32 • Beitrag als PDF

Hallo,

da du über PHP direkt sendest, müsstest du prüfen, ob die Einstellungen dazu in der php.ini auch passen.
Besser wäre aber über einen SMTP-Server zu senden.
Der ist entweder auf deinem Server drauf oder du kannst auch einen externen nehmen.
Damit bist du auf jeden Fall flexibler, kannst schneller auf Fehler reagieren, da du die Einstellungen selber ändern kannst und SMTP-Server können nach und nach die E-Mails verarbeiten, blockieren also in der Regel nicht so lange wie die PHP-Mail-Funktion, die erst wieder das Script weiter arbeiten lässt, wenn die E-Mail durch ist (ob mit oder ohne Fehler ist dabei egal).
Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per ICQ, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per ICQ, Email or PM. Each unasked message will be ignored!
Benutzeravatar
oxpus
Administrator
Administrator
 
Beiträge: 28979
Registriert: Mo 27.Jan, 2003 23:13
Wohnort: Bad Wildungen

Re: Ads-Mod, Fehler beim Aufruf

Beitragvon Holger » Do 07.Jun, 2012 08:54 • Beitrag als PDF

Hm, alle anderen Mails gehen ja raus ... PM, New reply usw.
Real men don’t back up, they learn data recovery. ;-)
http://www.mysqldumper.de
http://www.mysqldumper.se
Holger
User
User
 
Beiträge: 2253
Registriert: Mi 17.Mär, 2004 19:09

Re: Ads-Mod, Fehler beim Aufruf

Beitragvon oxpus » Do 07.Jun, 2012 14:20 • Beitrag als PDF

Ich habe ja nicht gesagt, dass PHP-Mail nicht funktioniert, aber wohl bei dir nicht immer fehlerfrei.
Oder die eingestellte E-Mail-Adresse ist fehlerhaft?
Zumal auch keine konkrete Fehlermeldung angezeigt wird, ist PHP-Mail ggf. hier nicht verfügbar gewesen...
Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per ICQ, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per ICQ, Email or PM. Each unasked message will be ignored!
Benutzeravatar
oxpus
Administrator
Administrator
 
Beiträge: 28979
Registriert: Mo 27.Jan, 2003 23:13
Wohnort: Bad Wildungen


Zurück zu phpBB 2 Support Board + Modifikationen

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 1 Gast