Précédent   Forum des professionnels en informatique > Systèmes > Linux > Applications
Applications Questions sur l'utilisation d'applications, du shell, et des interfaces graphiques (KDE, Gnome, XFCE... )
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 20/11/2007, 15h59   #1
Membre régulier
 
Avatar de HWICE
 
Homme
Développeur informatique
Inscription : décembre 2006
Messages : 246
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : Canada

Informations professionnelles :
Activité : Développeur informatique

Informations forums :
Inscription : décembre 2006
Messages : 246
Points : 70
Points : 70
Par défaut Avoir des accents avec SendEmail

Bonjour,
long time no see. Depuis quelque temps je fais des mailings avec Sendemail, euh pas vraiment mais baser dessu. MSC. Tout fonctionne très bien mais quand je veux mettre un objet avec des accents, ca me mets des points d'intérogation. Il y a t'il un moyen d'ajouter la balise iso-8859-1.
voici mon code de MSC
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/usr/bin/gosh
(use gauche.parseopt)
(use file.util)
 
(define (main args)
  (let-args (cdr args)
      ((from   "f|from=s" #f)
       (subject "s|subject=s" #f)
       (outfile "o|outfile=s" #f)
       (emails  "e|emails=s" #f)
       (message "m|message=s" #f)
       (attach  "a|attach=s" #f)
       (server  "r|server=s" "localhost:25")
       (wait    "w|wait=i" 60)
       (help    "h|help" => (cut show-help))
       )
      (if (not emails) (err "Emails file required"))
      (if (not (file-exists? emails)) (err (format #f "~a: not such file." emails)))
      (if (not from) (err "No from address"))
      (if (not subject) (err "no subject"))
      (let ((emailL (call-with-input-file emails (lambda (x) (port->list x))))
        (port (if outfile (open-output-file outfile)(current-output-port))))
    (display "#!/bin/bash" port)(newline port)
    (for-each
     (lambda (to)
       (format port "echo \"Sending to ~a...\"~%" to)
       (format port 
           "/usr/bin/sendEmail -vv -o message-file=~a -s ~s -f ~s -t ~s -u ~s " 
           message server from to subject)
       (if attach 
           (begin 
         (display "-a " port)
         (for-each
          (lambda (a)
            (display a port)
            (display " " port))
          (string-split attach ","))))
       (newline port)
       (format port "sleep ~a~%" wait))
     emailL))))
 
 
(define (show-help)
  (display (integer->char 27))
  (display "[1m")
  (display "msc (mail sender creator) version 0.1")
  (display (integer->char 27))
  (display "[47;0m")
  (newline)
  (display "Usage: msc [options]")(newline)
  (display "Arguments:")(newline)
  (display "   -f, --from         From address")(newline)
  (display "   -s, --subject      Subject")(newline)
  (display "   -o, --outfile      File to create [default: stdout]")(newline)
  (display "   -e, --emails       File containing the emails, one email per line")(newline)
  (display "   -a, --attach       Commas separated list of files to attach")(newline)
  (display "   -r, --server       SMTP server to use [default: localhost:25]")(newline)
  (display "   -m, --message      File containing body of message")(newline)
  (display "   -w, --wait         Time (in seconds) to wait between each sending [default: 60]")(newline)
  (display "   -h, --help         Display this help and exit")(newline)
  (newline)
  (exit))
 
(define (port->list port)
  (letrec ((read-data
            (lambda (d)
              (let ((line (read-line port)))
                (if (not (eof-object? line))
                    (begin
                      (set! d (cons line d))
                      (read-data d))
                    d)))))
    (read-data '())))
 
(define (err message)
  (display (integer->char 7))
  (display (integer->char 27))
  (display "[1;36m")
  (display " ERROR: ")
  (display message)(display "  ")
  (display (integer->char 27))
  (display "[47;0m")
  (newline)
  (show-help))
Merci de votre aide
__________________
Powered By Ubuntu/Linux GNU 9.10, Ubuntu/Linux GNU 10.10
HWICE est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 14/05/2008, 19h17   #2
Membre régulier
 
Avatar de HWICE
 
Homme
Développeur informatique
Inscription : décembre 2006
Messages : 246
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : Canada

Informations professionnelles :
Activité : Développeur informatique

Informations forums :
Inscription : décembre 2006
Messages : 246
Points : 70
Points : 70
euh
__________________
Powered By Ubuntu/Linux GNU 9.10, Ubuntu/Linux GNU 10.10
HWICE est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 01h04.


 
 
 
 
Partenaires

Hébergement Web