Page 1 sur 1

fonction mail

Posté : 13 mars 2008, 19:03
par karenma
Bonjour

J'utilise la fonction mail sur mes pages PHP mais je ne sait pas comment changer la couleur,la police,du mail envoyé.

Comment faire?
Merci d'avance pour votre aide

Re: fonction mail

Posté : 13 mars 2008, 21:27
par dunbar
Bonjour

J'utilise la fonction mail sur mes pages PHP mais je ne sait pas comment changer la couleur,la police,du mail envoyé.

Comment faire?
Merci d'avance pour votre aide
Envoyer un mail sous le format HTML peut-être ? :-k

couleur mail()

Posté : 14 mars 2008, 12:45
par karenma
bonjour
j'ai tenté du html mais le problème c qu'il m'affiche en toutes lettrres <html> et<font> dans le mail comment y remédier
Merci d'avance

Code : Tout sélectionner

<?php $titre = "essai1"; $boundary = md5(uniqid(rand())); $header =" "; $header .="From: php <[email protected]>n"; $header .="Reply-To: [email protected]\n"; $header .="MIME-Version: 1.0\n"; $header .="Content-Type: multipart/alternative; boudary=$boundary\n"; $sujet = ""; $sujet = "\nThis is a multi-part message in MIME format."; $sujet .= "\n--$boundary\nContent-Type: text/html; charset=\"iso-8859-1\"\n\n"; $sujet .= "<html><body>\n"; $sujet .= " <font color='red'>Bonjour </font> "; $sujet .= "</body></html>\n"; $sujet .= "\n--$boundary--\n end of the multi-part"; Mail("$mail",$titre,$sujet,$header); ?>

Re: couleur mail()

Posté : 14 mars 2008, 12:48
par agité
bonjour
j'ai tenté du html mais le problème c qu'il m'affiche en toutes lettrres <html> et<font> dans le mail comment y remédier
Merci d'avance

Code : Tout sélectionner

<?php $titre = "essai1"; $boundary = md5(uniqid(rand())); $header =" "; $header .="From: php <[email protected]>n"; $header .="Reply-To: [email protected]\n"; $header .="MIME-Version: 1.0\n"; $header .="Content-Type: multipart/alternative; boudary=$boundary\n"; $sujet = ""; $sujet = "\nThis is a multi-part message in MIME format."; $sujet .= "\n--$boundary\nContent-Type: text/html; charset="iso-8859-1"\n\n"; $sujet .= "<html><body>\n"; $sujet .= " <font color='red'>Bonjour </font> "; $sujet .= "</body></html>\n"; $sujet .= "\n--$boundary--\n end of the multi-part"; Mail("$mail",$titre,$sujet,$header); ?>
Tu as des scripts tout fait pour l'envois de mail : http://www.vulgarisation-informatique.com/mail.php

mail()

Posté : 14 mars 2008, 14:09
par karenma
bonjour
je suis allée voir ton lien mais ça ne fonctionne toujours pas pourquoi
j'ai essayé ton code avec simple guillemet et on me dit erreur de 'encapsed'
mais sinon j'ai l'impression qu'on a le même code
pourquoi je n'y arrive pas donc?
merci d'avance

mail

Posté : 15 mars 2008, 14:40
par karenma
je suis allée sur votre post-it mail et ça fonctionne