php.de

Zurück   php.de > Webentwicklung > PHP Einsteiger > PHP Tipps 2005

 
 
LinkBack Themen-Optionen Thema bewerten
Alt 14.02.2005, 13:05  
Gast
 
Beiträge: n/a
Standard fpdf und Email, geht das?

Hallo Leutz!

Ich habe mir mit der FPdf Class ein pdf erstellt.

Und jetzt meine Frage:

Kann ich das ganze jetzt auch als mail verschicken? Wenn ja, wie geht das, ich hab nämlich keinen Ahnung.

 
Sponsor Mitteilung
PHP Code Flüsterer

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

Alt 14.02.2005, 13:09  
Gast
 
Beiträge: n/a
Standard

Mit FPDF eine PDF-Datei erzeugen und diese als Attachment an die Mail hängen. Wo ist jetzt das Problem?

Gruß
phpfan
 
Alt 14.02.2005, 13:21  
Erfahrener Benutzer
 
Registriert seit: 02.04.2008
Beiträge: 2.603
Corvin befindet sich auf einem aufstrebenden Ast
Standard

15.7. Wie kann ich ein Attachment mit einer Mail versenden?
http://www.php-faq.de/q/q-mail-attachment.html
Corvin ist offline  
Alt 14.02.2005, 18:13  
Gast
 
Beiträge: n/a
Standard

Ok, vielen Dank für die Hinweise.

-> Noch eine Frage:

Wie mach ich dass mit dem erzeugten pdf-Document. Muß ich dass erst abspeichern (wenn ja , wie?) oder kann ich das attachment direkt als Variable dranhängen (wenn ja, wie?).
 
Alt 14.02.2005, 18:16  
Gast
 
Beiträge: n/a
Standard

Zitat:
Muß ich dass erst abspeichern (wenn ja , wie?)
Ist Doku lesen eigentlich gesundheitsgefährdend? Aus der Doku zu FPDF:

Output
string Output([string name [, string dest]])
Version
1.0
Description
Send the document to a given destination: string, local file or browser. In the last case, the plug-in may be used (if present) or a download ("Save as" dialog box) may be forced.
The method first calls Close() if necessary to terminate the document.
Parameters
name
The name of the file. If not given, the document will be sent to the browser (destination I) with the name doc.pdf.
dest
Destination where to send the document. It can take one of the following values:
I: send the file inline to the browser. The plug-in is used if available. The name given by name is used when one selects the "Save as" option on the link generating the PDF.
D: send to the browser and force a file download with the name given by name.
F: save to a local file with the name given by name.
S: return the document as a string. name is ignored.
If the parameter is not specified but a name is given, destination is F. If no parameter is specified at all, destination is I.

Note: for compatibility with previous versions, a boolean value is also accepted (false for F and true for D).

Gruß
phpfan
 
Alt 14.02.2005, 20:13  
Gast
 
Beiträge: n/a
Standard

Ok, danke. Habs mitlerweile auch selbst rausgefunden. Pdf-speichern klappt.

Nur die mail- class macht noch Probleme. Mit dem
Folgenden Code habe ich mal versucht. Die gespeicherte pdf-datei anzuhängen:

Code:
require_once('htmlMimeMail5/htmlMimeMail5.php');
    
    $mail = new htmlMimeMail5();

    /**
    * Set the from address
    */
    $mail->setFrom('Richard <tester@test.com>');
    
    /**
    * Set the subject
    */
    $mail->setSubject('Test email');
    
    /**
    * Set high priority
    */
    $mail->setPriority('high');

    /**
    * Set the text of the Email
    */
    $mail->setText('Sample text');
    
    /**
    * Set the HTML of the email
    */
    $mail->setHTML('Sample HTML [img]background.gif[/img]');
    
    /**
    * Add an embedded image
    */
    $mail->addEmbeddedImage(new fileEmbeddedImage('background.gif'));
    
    /**
    * Add an attachment
    */
    $mail->addAttachment(new fileAttachment('termine.pdf'));

    /**
    * Send the email
    */
    $mail->send(array('tester@test.de'));
Ich bekomme jetzt folgende Fehlermeldung:


Code:
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /htmlMimeMail5/htmlMimeMail5.php on line 30

Fatal error: Cannot instantiate non-existent class: htmlmimemail5 in
??
 
Alt 14.02.2005, 20:16  
Gast
 
Beiträge: n/a
Standard

Und woher kennen wir jetzt htmlMimeMail5.php??? Bei genauer Betrachtung der Fehlermeldung ist doch darin der Fehler, oder?

Gruß
phpfan
 
Alt 14.02.2005, 20:24  
Gast
 
Beiträge: n/a
Standard

Code:
require_once('htmlMimeMail5/htmlMimeMail5.php');
Dieser Befehl bindet doch die Datei ein, oder?

Also müsste sie doch bekannte sein ... !?!?
 
Alt 14.02.2005, 20:36  
Gast
 
Beiträge: n/a
Standard

Hab den Fehler gefunde...

Konnte nicht funktionieren, weil ich die Vers. 5 von mime.mail benutzen wollte. Die geht aber , wie ich gerade gelesen hab nur mit php5.

Werde es jetzt mit einer älteren vers. probieren
 
Alt 14.02.2005, 20:37  
Gast
 
Beiträge: n/a
Standard

Ich brech' hier gleich zusammen, liegt das am Wetter oder warum kommen heute laufend solche Sachen rein?

Ich tippe noch mal langsam, damit du das vielleicht diesmal verstehst:

Und woher kennen wir jetzt htmlMimeMail5.php???

Darin ist der Fehler, aber diese Datei hast du nicht gepostet.

Gruß
phpfan
 
 


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
Abfrage ob email adresse schon vorhanden ist TeazY PHP Tipps 2008 10 16.12.2007 12:22
email decodieren / imap_fetchbody malabarista PHP Tipps 2006 0 19.10.2006 09:53
DB Abfrage nach email funktioniert nicht tinchen Datenbanken 3 15.05.2006 13:20
Newsletter email abfrage Problem mokus PHP Tipps 2006 7 18.04.2006 16:35
email test shocky PHP Tipps 2006 2 16.03.2006 13:55
FPDF error: Could not include font definition file madSoul PHP Tipps 2005-2 0 13.09.2005 15:13
ausgeführte .php datei mit fpdf, soll sich selbst per mail v djrace PHP Tipps 2005-2 11 06.08.2005 14:45
[Erledigt] automatisch Email PHP Tipps 2005-2 3 26.07.2005 12:53
[Erledigt] doppelte email adressen suchen Datenbanken 9 20.05.2005 19:38
Email aus textarea PHP Tipps 2005 3 14.04.2005 21:37
Formular mit fpdf erzeugen! Boennchen PHP Tipps 2005 4 01.02.2005 11:59
Zeitversetzte Email versenden pcschröda PHP-Fortgeschrittene 9 29.01.2005 05:47
eMail kontrolle PHP Tipps 2004-2 1 20.12.2004 13:01
Wie implementiere ich mein Email Formular? PHP Tipps 2004-2 2 14.11.2004 17:02
Email per PHP formatieren PHP Tipps 2004 4 26.07.2004 09:49

Besucher kamen über folgende Suchanfragen bei Google auf diese Seite
fpdf email, fpdf als email, fpdf mail versenden, fpdf ouptput destination, fatal error attachment htmlmimemail5.php, fpdf send email, fpdf email fehler, fpdf als string verwenden

Alle Zeitangaben in WEZ +2. Es ist jetzt 08:57 Uhr.




Powered by vBulletin® Version 3.7.2 (Deutsch)
Copyright ©2000 - 2012, 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.