php.de

Zurück   php.de > Webentwicklung > PHP Einsteiger > PHP Tipps 2004-2

 
 
LinkBack Themen-Optionen Thema bewerten
Alt 28.11.2004, 20:14   #1 (permalink)
18inch
Gast
 
Beiträge: n/a
Standard mehrere Atachement mit HTML Mime mail class???

Hallo,
ich habe mir die HTML Mime mail class runtergeladen um txt-Dateianhänge per Email zu verschicken.
Nun möchte ich mehrere Dateien mit der Klasse in einer E-Mail verschicken. Jedoch funktioniert das nicht.
Hier der Code, wenn jeder Anhang einzelnd verschickt wird. Das funktioniert wunderbar!!!
PHP-Code:
error_reporting(E_ALL);
    include(
'htmlMimeMail.php');
    ...............
    ................
    ................
    
$result_plz mysql_query($plz_sql) OR die(mysql_error());
    while(
$row_plzgesamt mysql_fetch_array($result_plz))
    {
        ................
        
$result_mailing mysql_query($mailing_sql) OR die(mysql_error());
        
        while(
$row_mailing mysql_fetch_array($result_mailing))
        {
            if(
$row_mailing['sammel']==0)
            {
                
$sammeln "";
            }    else
                {
                    
$sammeln "/sammel";
                }
            
$ordner date("Y_m_d",time());
            
$file_name $ordner."/".$row_mailing['dplz']."".$sammeln."/".$row_mailing['data_name'].".txt";
            echo(
"

"
.$file_name);
            
$file $row_mailing['data_name'].".txt";
            
            
$mail = new htmlMimeMail();
            
$attachment $mail->getFile($file_name);
            
$mail->addAttachment($attachment$file'text/plain');
            
$text "PLZ-Bereich:".$row_plzgesamt['gesamtplz'];
            
$mail->setText($text);
            
$mail->setFrom('rechnung@wirbringenes.de');
            
$result $mail->send(array($row_mailing['email']));
            echo 
$result 'Mail sent!' 'Failed to send mail';
        }
        
    }
    
    
mysql_close(); 
Und hier der Code, wenn ich alles in einer E-Mail verschicken möchte:
PHP-Code:
error_reporting(E_ALL);
    include(
'htmlMimeMail.php');
    ...................
    ....................
    ..................
    
$result_plz mysql_query($plz_sql) OR die(mysql_error());
    while(
$row_plzgesamt mysql_fetch_array($result_plz))
    {
        .....................
        
$result_mailing mysql_query($mailing_sql) OR die(mysql_error());
        
        
$mail = new htmlMimeMail();
        
        while(
$row_mailing mysql_fetch_array($result_mailing))
        {
            if(
$row_mailing['sammel']==0)
            {
                
$sammeln "";
            }    else
                {
                    
$sammeln "/sammel";
                }
            
$ordner date("Y_m_d",time());
            
$file_name $ordner."/".$row_mailing['dplz']."".$sammeln."/".$row_mailing['data_name'].".txt";
            echo(
"

"
.$file_name);
            
$file $row_mailing['data_name'].".txt";
            
            
$attachment $mail->getFile($file_name);
            
$mail->addAttachment($attachment$file'text/plain');
        }
        
$text "PLZ-Bereich:".$row_plzgesamt['gesamtplz'];
        
$mail->setText($text);
        
$mail->setFrom('rechnung@wirbringenes.de');
        
$result $mail->send(array($row_mailing['email']));
        echo 
$result 'Mail sent!' 'Failed to send mail';
    }
    
    
mysql_close(); 
Zweiter COde funktioniert nicht. Kann mir einer sagen wieso???
Als Fehlermeldung erhalte ich immer: No recipient addresses found in header

Vielen Dank
Euer 18inch
 
Sponsor Mitteilung
PHP Code Flüsterer

Registriert seit: 21.08.2005
Beiträge: 4682
PHP-Kenntnisse:
Fortgeschritten

Alt 28.11.2004, 23:58   #2 (permalink)
Gast
 
Beiträge: n/a
Standard

Nach dem Durchlauf der while-Schleife ist $row_mailing false weil alle Zeilen abgearbeitet sind (das ist ja auch die Abbruchbedingung), und damit ist $row_mailing['email'] leer.

Wolfgang
http://www.zackbagga.com
 
 


Themen-Optionen
Thema bewerten
Thema bewerten:

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an
Gehe zu

Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
[Erledigt] HTML Mail mit Lücken mitten in den Worten, wie kommt das? DeeFour PHP-Fortgeschrittene 2 29.05.2008 15:47
Fatal error: Class 'HTML' not found in C:\xampp\htdocs\SMC\common.php on line 18 Raito PHP Tipps 2008 4 05.03.2008 16:17
Problem beim erstellen einer HTML Mail... GELight PHP Tipps 2006 15 06.10.2006 00:27
HTML Mail mit Code über Formular/Textfeld madSoul PHP Tipps 2006 5 28.04.2006 12:33
html mail CHRIS PHP Tipps 2005-2 3 18.10.2005 21:44
html mail versenden PHP Tipps 2005-2 3 17.09.2005 13:48
Mit der PHP mail() Funktion eine HTMl mail verschicken? PHP Tipps 2005 6 09.05.2005 07:13
html mail ich gebs auf :-( PHP Tipps 2005 17 03.03.2005 12:13
pear mime mail >> attachment funktioniert nicht PHP Tipps 2005 4 28.01.2005 16:23
[Erledigt] html mit mail versenden PHP-Fortgeschrittene 0 27.01.2005 19:53
[Erledigt] bilder in html mail PHP-Fortgeschrittene 11 10.01.2005 20:03
pear mime mail funktioniert nicht überall PHP Tipps 2005 4 05.01.2005 20:42
Mime Mail mit multipart/related anzeigen PHP-Fortgeschrittene 0 08.12.2004 19:01
html mail PHP Tipps 2004 2 03.08.2004 09:05
Antwort mail aus Kontaktformular in HTML, aber wie?! medico PHP Tipps 2004 2 14.07.2004 16:30

Besucher kamen über folgende Suchanfragen bei Google auf diese Seite
htmlmimemail attachment, htmlmimemail addattachment, php addattachment, mimemail, addattachment php, php html mime mail php 4, mail klasse, mime mail mehrere anhänge, htmlmimemail, http://www.php.de/php-tipps-2004-2/13145-mehrere-atachement-mit-html-mime-mail-class.html, html mime class php, html mime mail class 2005, htmlmail->addattachment, htmlmimemail mehrere dateien anhängen, htmlmimemail5 licence beding, php multipart mail class addattachment, php kontaktformular files anhängen, mime atachement, addattachment htmlmimemail, no recipient addresses found in header

Alle Zeitangaben in WEZ +2. Es ist jetzt 18:05 Uhr.




Powered by vBulletin® Version 3.7.2 (Deutsch)
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Aprilia-Forum, Aquaristik-Forum, Liebeskummer-Forum, Zierfisch-Forum, Geizkragen-Forum

Creative Commons License
Dieser Inhalt ist unter einer Creative Commons-Lizenz lizenziert.