| 11 | | As all Wiki pages, this page is editable, this means that you can |
| 12 | | modify the contents of this page simply by using your |
| 13 | | web-browser. Simply click on the "Edit this page" link at the bottom |
| 14 | | of the page. WikiFormatting will give you a detailed description of |
| 15 | | available Wiki formatting commands. |
| | 9 | * Utilisation de la fonction mail() de PHP |
| | 10 | * Ouverture d’un socket de connexion et dialogue avec un serveur SMTP |
| | 11 | * Appel système à un MTA local (Sendmail, Postfix, …) |
| 22 | | You can use [wiki:TracAdmin trac-admin] to configure |
| 23 | | [http://trac.edgewall.com/ Trac] to better fit your project, especially in |
| 24 | | regard to ''components'', ''versions'' and ''milestones''. |
| | 15 | La version 3.0 est une version complètement réécrite en PHP5.[[BR]] |
| | 16 | « Pourquoi ? La version actuelle (2.x) semble bien fonctionner », me direz-vous. Certes, mais on ne peut pas nier que le code soit un peu vieillot. J’ai commencé à développer Wamailer en 2002 et la version courante, modulo quelques corrections au cours des ans et pour les besoins de [http://phpcodeur.net/wascripts/wanewsletter/ Wanewsletter], date de 2003. Bref, tout cela méritait un bon nettoyage, et la tentation de tout refaire proprement était forte… |
| | 17 | |
| | 18 | Je préfère vous laisser lire le code plutôt que de tenter de vous décrire de manière obscure et maladroite la façon dont j’ai souhaité architecturer l’ensemble. |
| | 19 | |
| | 20 | Voici un exemple basique d’utilisation: |
| | 21 | |
| | 22 | {{{ |
| | 23 | <?php |
| | 24 | require 'mailer.class.php'; |
| | 25 | |
| | 26 | $email = new Email(); |
| | 27 | $email->addRecipient("bobe <my@address.tld>"); |
| | 28 | $email->setSubject("Ici, le sujet"); |
| | 29 | $email->setTextBody("Ici, le message"); |
| | 30 | |
| | 31 | Mailer::send($email); |
| | 32 | ?> |
| | 33 | }}} |
| | 34 | |
| | 35 | Un autre exemple avec cette fois un message en HTML et un fichier joint: |
| | 36 | |
| | 37 | {{{ |
| | 38 | <?php |
| | 39 | require 'mailer.class.php'; |
| | 40 | |
| | 41 | $message = "<p>Ici, le <strong>message en HTML</strong>!</p> |
| | 42 | |
| | 43 | <p>Une image :</p> |
| | 44 | <img src='http://example.org/path/to/image.png' alt='my text'> |
| | 45 | <p>Ciao!</p>"; |
| | 46 | |
| | 47 | $email = new Email(); |
| | 48 | $email->setFrom('one@example.org', 'Aurélien'); |
| | 49 | $email->addRecipient('my@address.tld', 'bobe'); |
| | 50 | $email->setSubject("Ici, le sujet"); |
| | 51 | $email->setHTMLBody($message); |
| | 52 | $email->attach('/path/to/file'); |
| | 53 | |
| | 54 | Mailer::send($email); |
| | 55 | ?> |
| | 56 | }}} |
| | 57 | |
| | 58 | [D’autres exemples ou une page 'exemple' à venir] |
| | 59 | |
| | 60 | Bien entendu, n’hésitez pas à tester tout cela et me faire parvenir vos remarques! [[BR]] |
| | 61 | ''Bobe'' |
| 29 | | Enjoy! [[BR]] |
| 30 | | ''The Trac Team'' |
| 31 | | |
| 32 | | == Starting Points == |
| 33 | | |
| 34 | | * TracGuide -- Built-in Documentation |
| 35 | | * [http://projects.edgewall.com/trac/ The Trac project] -- Trac Open Source Project |
| 36 | | * [http://projects.edgewall.com/trac/wiki/TracFaq Trac FAQ] -- Frequently Asked Questions |
| 37 | | * TracSupport -- Trac Support |
| 38 | | |
| 39 | | For a complete list of local wiki pages, see TitleIndex. |
| 40 | | |
| 41 | | Trac is brought to you by [http://www.edgewall.com/ Edgewall Software], |
| 42 | | providing professional Linux and software development services to clients |
| 43 | | worldwide. Visit http://www.edgewall.com/ for more information. |
| | 66 | * [http://phpcodeur.net/wascripts/wamailer/ Wamailer] -- Présentation de Wamailer sur le site phpcodeur.net |
| | 67 | * [source:trunk/ Browse source] -- Accèder au code en développement de Wamailer 3.0 |