ethernal Chercheur de vérité... | berceker> tu rigoles là le serveur de mail n'a rien à voir dans l'histoire. il reçoit un mail et le traite, que ce soit en php ou en asp.
Tu vas le surcharger inutilement.
un exemple d'utilisation
Code :
- require("class.phpmailer.php" );
- $mail = new phpmailer();
- $mail->From = "list@mydomain.com";
- $mail->FromName = "List manager";
- $mail->Host = "smtp1.site.com;smtp2.site.com";
- $mail->Mailer = "smtp";
- @MYSQL_CONNECT("localhost","root","password" );
- @mysql_select_db("my_company" );
- $query = "SELECT full_name, email, photo FROM employee WHERE id=$id";
- $result = @MYSQL_QUERY($query);
- while ($row = mysql_fetch_array ($result))
- {
- $mail->AddAddress($row["email"], $row["full_name" );
- }
- // HTML body
- $body = "Hello <font size=\"4\">" . $row["full_name"] . "</font>, <p>";
- $body .= "<i>Your</i> personal photograph to this message.<p>";
- $body .= "Sincerely, <br>";
- $body .= "phpmailer List manager";
- // Plain text body (for mail clients that cannot read HTML)
- $text_body = "Hello " . $row["full_name"] . ", \n\n";
- $text_body .= "Your personal photograph to this message.\n\n";
- $text_body .= "Sincerely, \n";
- $text_body .= "phpmailer List manager";
- $mail->Body = $body;
- $mail->AltBody = $text_body;
- $mail->AddStringAttachment($row["photo"], "YourPhoto.jpg" );
- if(!$mail->Send())
- echo "There has been a mail error sending to " . $row["email"] . "<br>";
|
http://phpmailer.sourceforge.net/
utiliser une classe toute faites et programmer une classe c'est différent.
Et viens pas me dire que c'est compliqué ! je dirais que c'est plutôt l'inverse.
---------------
...oups kernel error...
|