Bonjour à tous,
Voilà, j'aimerai envoyer un mail via le module HTML::Mail à plusieurs contacts.
Dans le champs 'To=>', je mets un tableau mais je m'aperçois que le mail n'est envoyé qu'au premer contact (uniquement à $mailing[0]).
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 sub Template_customer() { ### initialisation my $code=$_[0]; my $mailing_list=$_[1]; my @mailing=split(';',$mailing_list); my $html_mail = HTML::Mail->new( HTML => 'http://localhost/test/v2.0/cgi-bin/mail_template_customer.pl?CODE='.$code, Text => 'Hello\n,We need you to complete the partner form for the new customer: $host\nPlease fill the empty cases and clik on send form!\n', From => 'euredi@saint-gobain.com', To => @mailing, Subject => 'EDI partner form: information requested'); ### Send the email ("inherited" from MIME::Lite) $html_mail->send('smtp',$host); }
Comment peut on faire pour envoyer à plusieurs contacts ?
Partager