Last change
on this file since 28930 was
27949,
checked in by marcimat@…, 12 years ago
|
- conserver dans inc/envoyer_mail la fonction nettoyer_titre_email() utilisee par inc/notification.php
|
File size:
1002 bytes
|
Line | |
---|
1 | <?php |
---|
2 | |
---|
3 | |
---|
4 | include_spip('inc/facteur_classes'); |
---|
5 | |
---|
6 | |
---|
7 | function inc_envoyer_mail($destinataire, $sujet, $corps, $from = "", $headers = "") { |
---|
8 | $message_html = ''; |
---|
9 | $message_texte = ''; |
---|
10 | if (is_array($corps)) { |
---|
11 | $message_html = $corps['html']; |
---|
12 | $message_texte = $corps['texte']; |
---|
13 | $pieces_jointes = $corps['pieces_jointes']; |
---|
14 | } else { |
---|
15 | $message_texte = $corps; |
---|
16 | } |
---|
17 | $notification = new Facteur($destinataire, $sujet, $message_html, $message_texte); |
---|
18 | if (!empty($from)) |
---|
19 | $notification->From = $from; |
---|
20 | if (count($pieces_jointes)) { |
---|
21 | foreach ($pieces_jointes as $piece) { |
---|
22 | $notification->AddAttachment($piece['chemin'], $piece['nom'], $piece['encodage'], $piece['mime']); |
---|
23 | } |
---|
24 | } |
---|
25 | return $notification->Send(); |
---|
26 | } |
---|
27 | |
---|
28 | |
---|
29 | |
---|
30 | /** Conserver les fonctions de SPIP car il en utilise certaines ! **/ |
---|
31 | |
---|
32 | // utilisee par inc/notifications.php |
---|
33 | // http://doc.spip.org/@nettoyer_titre_email |
---|
34 | function nettoyer_titre_email($titre) { |
---|
35 | return str_replace("\n", ' ', supprimer_tags(extraire_multi($titre))); |
---|
36 | } |
---|
37 | |
---|
38 | |
---|
39 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.