no save
Assistance
Achat
News

Forum | webmastering
PHP comment mettre une image dans un mail ?
Smoking bird, le mer. 14 mai 2008 à 21:06:21
Salut à tous!

Je code en PHP5 sur un hébergement de celeonet, et je m'essai à l'envoi de mails en html avec images incluses. Le mail html passe, mais pas l'image. Voici le code, qu'en dites vous? Comment puis je envoyer l'image?

$this->boundary=md5(uniqid(rand()));
echo $this->boundary."<br/>";
$this->header="";
$this->header.="From: Reprod <contacts@reprod.org>\n";
$this->header.="Reply-To: contacts@reprod.org\n";
$this->header.="MIME-version: 1.0\n";
$this->header.="Content-Type: multipart/mixed;
boundary=".$this->boundary."\n";

$this->html="\nThis is a multi-part message in MIME format.";
$this->html.="\n--".$this->boundary."\nContentType: text/html;
charset=\"iso-8859-1\"\n\n";
$this->html.="\n";
$this->html.="L'administrateur de Reprod a ouvert votre profil\n";
$this->html.="Vous pouvez vous connecter à l'adresse suivante: ";
$this->html.="http://www.url.com/\n";
$this->html.="Voici vos identifiants de connexion:\n";
$this->html.="Pseudo:".$this->pseudo;
$this->html.="\nCode:".$this->pass;
$this->html.="<img src=\"http://spheresoccultes.com/galerie/export_masque_femme.jpg\"/>\n";
$this->html.="\n--".$this->boundary;
$this->html.="\nContent-Type: image/jpeg; name=\"export_masque_femme.jpg\"";
$this->html.="\nContent-Transfer-Encoding: base64";
$this->html.="\nContent-Disposition: inline";
$this->html.="\n <base64 encoded data for the http://spheresoccultes.com/galerie/export_masque_femme.jpg image>";
$this->html.="\n";
$this->html.="\n--".$this->boundary."--\n end of multipart";


if( mail($this->mail,"Vous êtes inscrits à Reprod!",$this->html,$this->header) )
{
echo "Inscription notifiée";
}else{
echo "Mail raté";
}

}

Merci de votre patience et de votre aide :)Configuration: Windows XP
Opera 9.27


Smoking bird
mai 08
Suivant
REPONSES
Smoking bird
mai 08
Smoking bird
mai 08
Smoking bird
mai 08
hackzor44
mai 08
Smoking bird
mai 08
Version Web
Réalisé par RedShift
no save