Ich bin ja kein Profi, 
aber wenn ich mir die Funktion ansehe, die Du aufrufst (generate_text_for_storage()):
Code: Alles auswählen
676  function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bbcode = false, $allow_urls = false, $allow_smilies = false, $allow_img_bbcode = true, $allow_flash_bbcode = true, $allow_quote_bbcode = true, $allow_url_bbcode = true, $mode = 'post')
 677  {
 678      global $phpbb_root_path, $phpEx, $phpbb_dispatcher;
 679  
 680      /**
 681      * Use this event to modify the text before it is prepared for storage
 682      *
 683      * @event core.modify_text_for_storage_before
 684      * @var string    text            The text to parse
 685      * @var string    uid                The BBCode UID
 686      * @var string    bitfield        The BBCode Bitfield
 687      * @var int        flags            The BBCode Flags
 688      * @var bool        allow_bbcode    Whether or not to parse BBCode
 689      * @var bool        allow_urls        Whether or not to parse URLs
 690      * @var bool        allow_smilies    Whether or not to parse Smilies
 691      * @var bool        allow_img_bbcode    Whether or not to parse the img] BBCode
 692      * @var bool        allow_flash_bbcode    Whether or not to parse the flash] BBCode
 693      * @var bool        allow_quote_bbcode    Whether or not to parse the quote] BBCode
 694      * @var bool        allow_url_bbcode    Whether or not to parse the url] BBCode
 695      * @var string    mode                Mode to parse text as, e.g. post or sig
 696      * @since 3.1.0-a1
 697      * @changed 3.2.0-a1 Added mode
 698      */
 699      $vars = array(
 700          'text',
 701          'uid',
 702          'bitfield',
 703          'flags',
 704          'allow_bbcode',
 705          'allow_urls',
 706          'allow_smilies',
 707          'allow_img_bbcode',
 708          'allow_flash_bbcode',
 709          'allow_quote_bbcode',
 710          'allow_url_bbcode',
 711          'mode',
 712      );
 713      extract($phpbb_dispatcher->trigger_event('core.modify_text_for_storage_before', compact($vars)));
 714  
 715      $uid = $bitfield = '';
 716      $flags = (($allow_bbcode) ? OPTION_FLAG_BBCODE : 0) + (($allow_smilies) ? OPTION_FLAG_SMILIES : 0) + (($allow_urls) ? OPTION_FLAG_LINKS : 0);
 717  
 718      if (!class_exists('parse_message'))
 719      {
 720          include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
 721      }
 722  
 723      $message_parser = new parse_message($text);
 724      $message_parser->parse($allow_bbcode, $allow_urls, $allow_smilies, $allow_img_bbcode, $allow_flash_bbcode, $allow_quote_bbcode, $allow_url_bbcode, true, $mode);
 725  
 726      $text = $message_parser->message;
 727      $uid = $message_parser->bbcode_uid;
 728  
 729      // If the bbcode_bitfield is empty, there is no need for the uid to be stored.
 730      if (!$message_parser->bbcode_bitfield)
 731      {
 732          $uid = '';
 733      }
 734  
 735      $bitfield = $message_parser->bbcode_bitfield;
 736  
 737      /**
 738      * Use this event to modify the text after it is prepared for storage
 739      *
 740      * @event core.modify_text_for_storage_after
 741      * @var string    text            The text to parse
 742      * @var string    uid                The BBCode UID
 743      * @var string    bitfield        The BBCode Bitfield
 744      * @var int        flags            The BBCode Flags
 745      * @var string    message_parser    The message_parser object
 746      * @since 3.1.0-a1
 747      * @changed 3.1.11-RC1            Added message_parser to vars
 748      */
 749      $vars = array('text', 'uid', 'bitfield', 'flags', 'message_parser');
 750      extract($phpbb_dispatcher->trigger_event('core.modify_text_for_storage_after', compact($vars)));
 751  
 752      return $message_parser->warn_msg;
 753  }
dann dienst sie dazu 
Use this event to modify the text before it is prepared for storage
 den Text zu modifizieren, bevor er geparsed wird.
Neben des Löschens der uid, wenn bitfield leer ist 
If the bbcode_bitfield is empty, there is no need for the uid to be stored.
gibt die Funktion 
return $message_parser->warn_msg
 Warnmeldungen aus, wenn beim parsen Fehler auftreten.
Wenn Du eine programmtechnisch erzeugte Mail versenden willst, die du ja sicher testen wirst und diese nicht ständig geändert wird,..... wozu diese Funktion überhaupt verwenden ? es klingt so, als wenn Du reinen Text versenden willst, der vlt. einen Zeilenumbruch enthält. Muss der dann so explizit getestet werden ?
Bin gespannt, ob ich jetzt lerne, dass man das so macht..... 
  