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
|
...
push(@contenu_mail, "Subject: $subject\n");
#push(@contenu_mail, "Mime-Version: 1.0\n");
push(@contenu_mail, "Content-Type: text/xml; charset=\"iso-8859-1\"\n");
#push(@contenu_mail, "Content-Transfer-Encoding: quoted-printable\n");
push(@contenu_mail, "\n");
$message = <<_CONTENUMAIL_;
<?xml version="1.0" encoding="ISO-8859-1" ?>
<?xml-stylesheet type="text/xsl" href="http://serveur/lib/mail.xsl" ?>
<notification>
<type>$v_notification</type>
<host>$v_host</host>
<adress>$v_adresse</adress>
<service>$v_service</service>
<status>$v_status</status>
<date>$v_date</date>
<heure>$v_heure</heure>
<tok>$v_totok</tok>
<twa>$v_totwa</twa>
<tcr>$v_totcr</tcr>
<tun>$v_totun</tun>
</notification>
_CONTENUMAIL_
#$message = MIME::QuotedPrint::encode_qp($message);
# Je fais la connection et j'envoie le mail.
foreach $i (@T){
unshift(@contenu_mail,"To: $i\n");
unshift(@contenu_mail,"From: $mail_from\n");
$smtp ="serveur.smtp.com";
$smtp = Net::SMTP->new($smtp);
$smtp->mail($mail_from);
$smtp->to($i);
$smtp->data(@contenu_mail);
$smtp->quit;
} |
Partager