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
|
# creation mail et envoi
# entete
$Message = new MIME::Lite
From =>'toto@toto.fr',
To =>'titi@titi.com',
Subject =>'mail html avev piece jointe',
Type =>'multipart/mixed';
# creation du message
$TXTMessage = new MIME::Lite
Type =>'TEXT',
Data =>$corps_mail;
# Modification du type (HTML)
$TXTMessage->attr("content-type" => "text/html; charset=iso-8859-1");
# Attachez le message au mail
$Message->attach ($TXTMessage);
# creation du fichier joint
$FICMessage = new MIME::Lite
Type =>'img/jpg',
Path =>'image.jpg',
Filename =>'image.jpg';
# Attachez l'image au mail
$Message->attach ($FICMessage);
# envoi
$Message->send; |
Partager