[FPDF] Envoi d'un mail au format PDF avec PHP
salut
j'utilise la classe pdf.php pour la création de mon fichier pdf.
puis la classe mime_mail.php , pour l'envoi.
Le prob c ke si j'execute la page , seulement la génération du pdf fonctionne !!!!!!
je ne comprend pas pour koi
voici la derniere partie du code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| $file_name = "devis.pdf";
$pdf->output($file_name);
//envoi du mail
require "smarty/libs/mime_mail.php";
$fichier = "$file_name";
$mail = new mime_mail();
$mail->to = "tarek.chida@gmail.com"; // Adresse email de reception
$mail->subject = "Devis "; // Sujet
$mail->body = "un nouveau devis "; // Corps du message
$mail->from = "commercial@xxx.tn"; // Adresse email de l'expediteur (optionnel)
$mail->attach("$fichier"); // fichier attache (optionnel)
echo "mail en route";
// envoi du message
$mail->send(); |
Si vous pouvez m'aider
MERCI ;)