Forum Linux.redhat Problème envoi mail PHP & LINUX

Posté par  .
Étiquettes : aucune
0
27
nov.
2007
Bonjour,

Je suis debutant en linux et la société qui m'embauche m'a demandé de réaliser une application en php qui me permet de créer automatiquement des cartes de recharges et également les envoyer par mail au service comptabilité.
Pour mes tests j'utilise esayphp 1.8 sous XP.
La configuration du php.ini me permet en local d'envoyer mon mail correctement.
Je precise que mon mail comporte en background une image que je joint à l'expédition du mail.
Tout fonctionne parfaitement en local.
Le plus dur maintenant était de parametrer sendmail sous REDHAT pour transcrire le projet WINDOWS sous linux.
Là aussi pas de problème d'autant plus que le mail part mais le "HIC" est que à la reception du mail; contrairement à easyphp où je recevais ma cartes ainsi que le background, je reçois le code du tableau contenu dans le corp du message.


Ce qui me donne :

Code :

Content-Type: multipart/related; boundary="-----=b5ac5d300e2bc24fa91d717402875163"




Je vous informe que ceci est un message au format MIME 1.0 multipart/mixed.
-------=b5ac5d300e2bc24fa91d717402875163
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding:8bit










 
 



 
ddha@lc1



 
7874



 
2008-02-25



 
 




-------=b5ac5d300e2bc24fa91d717402875163
Content-Type: application/octet-stream; name="fond2_1.jpg"
Content-Transfer-Encoding: base64
Content-ID:

/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAAPAAA/+4ADkFkb2JlAGTAAAAAAf/b
AIQABgQEBAUEBgUFBgkGBQYJCwgGBggLDAoKCwoKDBAMDAwMDAwQDA4PEA8ODBMTFBQTExwbGxsc
Hx8fHx8fHx8fHwEHBwcNDA0YEBAYGhURFRofHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8f
Hx8fHx8fHx8fHx8fHx8fHx8f/8AAEQgDBQRCAwERAAIRAQMRAf/EANkAAQACAwEBAQEAAAAAAAAA
AAAEBQIDBgcBCAkBAQADAQEBAQEAAAAAAAAAAAABAgMEBQYHCBAAAgIBBAECBAMDBwcGCQIXAQID
BAUAERIGITETQSIUB1FhMn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/ExIKxyAhQfPnYh
/wBO4/n1VpLELgTur4vIPeY463Fyg8yluYBRiQBxIDMGC7/l+3WfyfmYbieah1N6iblw070Aeko9
xCCwDMPA3II9N/TXE7MrU22aVTRMhq1asIirxJFGPARAAP2nb1Osr9x0xeJMUfdcJcaA0WqVW3H7
dmJZV+AYbkfmD6g6tGbi6phoo7nUIwxkx8vtNt/dSbsh/Ll5YD+fXVDVtqklUo4FVYx92vuZ4GQD
bdtt18/6w3Gtlci8mKEfViBoBoBoBoCxw0rxWtiD7coIJ2O248g/nrn1CTj0otHBl5NlqdNAQpmm
Ox4fp2BG+538/wAmstPbjRuSq93D7erLpJk3uK2XP3ppQQQgJA8AE7b+m53GtXaUpc0m3IitFRHV
2LVetGZbEqQxggF5GCqCfAG5IGvRxbMyprdqpWriQUkaVGJBsEFU3APhQdmb0/LVLlx28V8SCVSz
eWR/1Hf8vh/Nrzr2pnc+J4eBoopZF9S/3WL/AGB/Vr9M8r/tbf5Uebd+J9Zv16BmNANANANANANA
NANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANA
NANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANA
NANANANANANARb0ipB8xABYLufxPp/Oded5o0rLrxRe18RXLYgeQxpKjSKN2QMCQN9tyAdxr5jmX
E6zZyGjmgfOX4DVXcFDU43Yk64rqrJsusiE2HxhWRfpYgJQVkIQAkMCCNwAfO+s3FvFMmp5HlsdJ
jcjPTcECJyEJ9WQndT48eV12RdVUo8CJqwL/AKVkDVzKwsQIrYMbb+ByHlD+3fx/Lrh8wtc1uu9F
7bxPR9fPHQNAQcpRFiLmg/fIDtt8R6ka1s3OV0eTIoUGu8qNANANANANAZRxySOERSzsfCgbknUp
NuiB0eM69HEFmtgPL6iPwVUn8f8ASI/m132tMli8zKUq5DNFpbUcQ/Si7k/hyP8AmGuTzC57yXQX
tLAiGtAYzGyB0P6gwBB2/EHXmc7TqmakWrhoKl5LVVzHsSHib5lKnwQD+oEa3lqXK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X5kgHcnZST8pDH+X+rXfG5JUkl7pRx3bzibFeevO8E6GOaM7Oh9Qf8oP5a7U
01VZGbVD0Lq8nu4WtIduQUx+PgIyVH9A14mphy3H0s3i6pFvrEkaAaAD121Ki26IkiZDK4/HxiS3
MIlJ4jwWO5BO2yhj6DWkLMpOiWJVuiqyDJ2LBSxhgxlDeQQjA7f+MFOrfp51o1QcyIsubw534JMp
+GwXb+lt9WWml0DnRrTNYzf957wUfBUTcj+V/GtbemX7T7iHPgS07FgIwCledpAdw7hTt/IG210O
3bivcXvcXtQrVvN4EiHuFDlsQ6Lt4JUeD+wE6W7l1N1aIcUWdWeO3CJ4GLxMSA+xG5B2PggH11zO
xN40LVRtIYfAjWTtyWaZNUU2aWrHGBGFSyxBBVRvx387+PjqV05EnMWcJHdn5Gd1kc+GbZgAT6Ae
PA311Q1LgqUVEUcKsh2enZSPzC0c4+ABKt/MwC/061h5hB5poh22ZYXE5Gjm6klqAxRI5LykgoAQ
QN2BKjydNRfhO21F1dBGLTVT0MEEAg7g+QR6ba8I3Okpf7pD/sj+rX6z5T/a2/yL0Hk3vjfWb9ei
ZjQDQDQGLukaF3IVFG7MfAAHkkk6A5H7c/can3iDM2qVR61PGZB6NaZ33NmIQxzJYClV4LIs26jz
8ux387ADsNAVVjtXV62YhwljL0oczPt7GNksRJZfkCRwhLBzuB8BoCi6l9wf8Q3JYDBUpiK3k6hg
ku8rb/wyyK/uxV/ZXlG3q55jgSo+bfcAWVT7gdDuGcVOyYqyasUs9oRXa7+1FAAZpJOLnisYO7Mf[/color]
####################################################

Je ne comprend plus rien puisque sous WINDOWS tout est OK tandis que sous LINUX le message n'affiche pas comme je le veux.

Voici le code PHP qui envoi mon mail :

####################################################
[color="Red"]<?
//----------------------------------
// Construction de l'entête
//----------------------------------
$delimiteur = "-----=".md5(uniqid(rand()));

$entete = "MIME-Version: 1.0\r\n";
$entete .= "Content-Type: multipart/related; boundary=\"$delimiteur\"\r\n";
$entete .= "\r\n";

//--------------------------------------------------
// Construction du message proprement dit
//--------------------------------------------------

$msg = "Je vous informe que ceci est un message au format MIME 1.0 multipart/mixed.\r\n";

//---------------------------------
// 1ère partie du message
// Le code HTML
//---------------------------------
$msg .= "--$delimiteur\r\n";
$msg .= "Content-Type: text/html; charset=\"iso-8859-1\"\r\n";
$msg .= "Content-Transfer-Encoding:8bit\r\n";
$msg .= "\r\n";
$msg .= "";
$msg .= "


<table width=\"1090`\">

<td width=\"1082\" height=\"769\">

<table width=\"1097\" height=\"771\" background=\"cid:image2\">

<td width=\"522\" height=\"394\"> 
<td width=\"563\" height=\"394\"> 



<td width=\"522\" height=\"26\"> 
<td width=\"563\" height=\"26\"> $chaine1



<td width=\"522\" height=\"58\"> 
<td width=\"563\" height=\"58\">$randomcartelc11



<td width=\"522\" height=\"21\"> 
<td width=\"563\" height=\"21\" valign=\"top\">$datexpire



<td width=\"522\" height=\"258\"> 
<td width=\"563\" height=\"258\"> 






\r\n";
$msg .= "\r\n";

//---------------------------------
// 2nde partie du message
// Le 1er fichier (inline)
//---------------------------------
$fichier = "fond2_1.jpg";
$fp = fopen($fichier, "rb");
$fichierattache = fread($fp, filesize($fichier));
fclose($fp);
$fichierattache = chunk_split(base64_encode($fichierattache));

$msg .= "--$delimiteur\r\n";
$msg .= "Content-Type: application/octet-stream; name=\"$fichier\"\r\n";
$msg .= "Content-Transfer-Encoding: base64\r\n";
$msg .= "Content-ID: \r\n";
$msg .= "\r\n";
$msg .= $fichierattache . "\r\n";
$msg .= "\r\n\r\n";




$destinataire = "angejudicael@africaonline.co.ci";
$expediteur = "didier@africaonline.co.ci";
$reponse = $expediteur;

mail($destinataire,
"Génération des cartes LC1",
$msg,
"Reply-to: $reponse\r\nFrom: $expediteur\r\n".$entete);

?>



Par défaut Problème avec PHP & LINUX
Bonjour,

Je suis debutant en linux et la société qui m'embauche m'a demandé de réaliser une application en php qui me permet de créer automatiquement des cartes de recharges et également les envoyer par mail au service comptabilité.
Pour mes tests j'utilise esayphp 1.8 sous XP.
La configuration du php.ini me permet en local d'envoyer mon mail correctement.
Je precise que mon mail comporte en background une image que je joint à l'expédition du mail.
Tout fonctionne parfaitement en local.
Le plus dur maintenant était de parametrer sendmail sous REDHAT pour transcrire le projet WINDOWS sous linux.
Là aussi pas de problème d'autant plus que le mail part mais le "HIC" est que à la reception du mail; contrairement à easyphp où je recevais ma cartes ainsi que le background, je reçois le code du tableau contenu dans le corp du message.


Ce qui me donne :

Code :

Content-Type: multipart/related; boundary="-----=b5ac5d300e2bc24fa91d717402875163"




Je vous informe que ceci est un message au format MIME 1.0 multipart/mixed.
-------=b5ac5d300e2bc24fa91d717402875163
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding:8bit










 
 



 
ddha@lc1



 
7874



 
2008-02-25



 
 




-------=b5ac5d300e2bc24fa91d717402875163
Content-Type: application/octet-stream; name="fond2_1.jpg"
Content-Transfer-Encoding: base64
Content-ID:

/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAAPAAA/+4ADkFkb2JlAGTAAAAAAf/b
AIQABgQEBAUEBgUFBgkGBQYJCwgGBggLDAoKCwoKDBAMDAwMDAwQDA4PEA8ODBMTFBQTExwbGxsc
Hx8fHx8fHx8fHwEHBwcNDA0YEBAYGhURFRofHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8f
Hx8fHx8fHx8fHx8fHx8fHx8f/8AAEQgDBQRCAwERAAIRAQMRAf/EANkAAQACAwEBAQEAAAAAAAAA
AAAEBQIDBgcBCAkBAQADAQEBAQEAAAAAAAAAAAABAgMEBQYHCBAAAgIBBAECBAMDBwcGCQIXAQID
BAUAERIGITETQSIUB1FhMnEjFYGRobFCMxbB0VJicjQX8JLSQyQI4YKislNzk0RUlDVVY7MlN/HC
NoOj00V1JlbDdCeEtLV2GBEAAgECAwQGBwUHBAIBBQADAAECEQMhMQTwQVESYXGBkaEFscHRIjIT
BuHxUnIUQmKSM1M0FcLSIweCFqKy4kMkF3ODo//aAAwD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bkfmD6g6tGbi6phoo7nUIwxkx8vtNt/dSbsh/Ll5YD+fXVDVtqklUo4FVYx92vuZ4GQD
bdtt18/6w3Gtlci8mKEfViBoBoBoBoCxw0rxWtiD7coIJ2O248g/nrn1CTj0otHBl5NlqdNAQpmm
Ox4fp2BG+538/wAmstPbjRuSq93D7erLpJk3uK2XP3ppQQQgJA8AE7b+m53GtXaUpc0m3IitFRHV
2LVetGZbEqQxggF5GCqCfAG5IGvRxbMyprdqpWriQUkaVGJBsEFU3APhQdmb0/LVLlx28V8SCVSz
eWR/1Hf8vh/Nrzr2pnc+J4eBoopZF9S/3WL/AGB/Vr9M8r/tbf5Uebd+J9Zv16BmNANANANANANA
NANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANA
NANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANA
NANANANANANARb0ipB8xABYLufxPp/Oded5o0rLrxRe18RXLYgeQxpKjSKN2QMCQN9tyAdxr5jmX
E6zZyGjmgfOX4DVXcFDU43Yk64rqrJsusiE2HxhWRfpYgJQVkIQAkMCCNwAfO+s3FvFMmp5HlsdJ
jcjPTcECJyEJ9WQndT48eV12RdVUo8CJqwL/AKVkDVzKwsQIrYMbb+ByHlD+3fx/Lrh8wtc1uu9F
7bxPR9fPHQNAQcpRFiLmg/fIDtt8R6ka1s3OV0eTIoUGu8qNANANANANAZRxySOERSzsfCgbknUp
NuiB0eM69HEFmtgPL6iPwVUn8f8ASI/m132tMli8zKUq5DNFpbUcQ/Si7k/hyP8AmGuTzC57yXQX
tLAiGtAYzGyB0P6gwBB2/EHXmc7TqmakWrhoKl5LVVzHsSHib5lKnwQD+oEa3lqXKLjJVKqKTqi9
BB9NciZYjXcTUyChJk3f+xIvhh+w/h51vYlNSSji2UlSmJyvc+vXaWPrPHK89OAlWGx2Qud+RA9A
T4/m19BC3KLdaNGDaaOdw+EvZax7VZdlH97MwPBB+ZHxP4am5dUFVkJM6TM4KjhsfBHES80rlpZ2
A5EKNtg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kVlJI6mhjq1KP
jEN2O3OQ+pI/qGvRt21FURk22RsxmoqCFE2eyw3VPgN/i23w1W7eUV0kqNStqyTS11lmJaWTdmY+
p3JI/o14N+TlNtm8VRG3WJYaAkxuPbDE7ADyf2azaxBhFljFKdkDp6b+jfyHXo6O/wDJrVJ17zOc
KlkLqPGGVSNx6MNj/KPOvQueZxp7uMjNW3vNcVeGKIJAixRjchEAVRudzsBsB5OuecOb3lmWTpgc
h36YA1Yh6hXJH5MQP/udX0qxdSJs44Eggj1HnXaUPTajpYjikTfhIocb+vEgEf0HXzbi02nuZ1Vw
LDVio0Bpkp139U2P4r4/8GlSSO+ObfeOTcfg3j+kakVI71bCeqEj8R5H9GpqSatSBoCXTyU9bZQe
cX+gT6fsPw116bWytYZx4ewzlbT6y6rXqltSoPzEeY2A3I/Z5BGvbs6q3dVE8eBhKDRByOKxpHyQ
ETn9Kw+P5xsVUa59TZtpYL3nw2oi0JPjgcle6Xl5pi7WEYk/pO4Kj4AKOS/+VrkV5W/daxW2ZZqu
NSL/AIcFPczwMxHq7gMo/m+XVXqXLJ0JUUixpuChT/R9B+R1yTWNS6Nlk146kstmVYouDAcjsWIH
6VA8sfPw1azbcngG0kcpLmQqiOrHxUDYFh4AH4KNejHTtusmZOXAz67Ymm7BSMrlzzO258D5T6D0
Go1UUrUqLcIPFHpmvnjoOjpf7pD/ALI/q1+teU/2tv8AIvQeTe+N9Zv16JmNANANANANANANANAN
ANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANAc
nle5XVzU+D69imzOSpokmQLTrVrVxKN40kmZZCXdfIVUPjydtbwsLlUpPlTy31MJXXXliq07CBJ9
zVrVlXI404/JR5Svir1WedRHEJ0976hZwpV41gVpPRfQg7eutFpKvB1jyt927vKvUUWKo+am3YdM
Oz9aOK/i4y1M4rfb+IfURfT777be7y4b7/nrD5U+blo+bhvNvmRpWqoZWOxYCtWhs2MlVhrWEaSC
eSeNUkRRyZkYsFZVXySDqqtybok20HONK1N8+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yDJ2LBSxhgxlDeQQjA7f+MFOrfp51o1QcyIsubw534JMp
+GwXb+lt9WWml0DnRrTNYzf957wUfBUTcj+V/GtbemX7T7iHPgS07FgIwCledpAdw7hTt/IG210O
3bivcXvcXtQrVvN4EiHuFDlsQ6Lt4JUeD+wE6W7l1N1aIcUWdWeO3CJ4GLxMSA+xG5B2PggH11zO
xN40LVRtIYfAjWTtyWaZNUU2aWrHGBGFSyxBBVRvx387+PjqV05EnMWcJHdn5Gd1kc+GbZgAT6Ae
PA311Q1LgqUVEUcKsh2enZSPzC0c4+ABKt/MwC/061h5hB5poh22ZYXE5Gjm6klqAxRI5LykgoAQ
QN2BKjydNRfhO21F1dBGLTVT0MEEAg7g+QR6ba8I3Okpf7pD/sj+rX6z5T/a2/yL0Hk3vjfWb9ei
ZjQDQDQGLukaF3IVFG7MfAAHkkk6A5H7c/can3iDM2qVR61PGZB6NaZ33NmIQxzJYClV4LIs26jz
8ux387ADsNAVVjtXV62YhwljL0oczPt7GNksRJZfkCRwhLBzuB8BoCi6l9wf8Q3JYDBUpiK3k6hg
ku8rb/wyyK/uxV/ZXlG3q55jgSo+bfcAWVT7gdDuGcVOyYqyasUs9oRXa7+1FAAZpJOLnisYO7Mf[/color]
####################################################

Je ne comprend plus rien puisque sous WINDOWS tout est OK tandis que sous LINUX le message n'affiche pas comme je le veux.

Voici le code PHP qui envoi mon mail :

####################################################
[color="Red"]<?
//----------------------------------
// Construction de l'entête
//----------------------------------
$delimiteur = "-----=".md5(uniqid(rand()));

$entete = "MIME-Version: 1.0\r\n";
$entete .= "Content-Type: multipart/related; boundary=\"$delimiteur\"\r\n";
$entete .= "\r\n";

//--------------------------------------------------
// Construction du message proprement dit
//--------------------------------------------------

$msg = "Je vous informe que ceci est un message au format MIME 1.0 multipart/mixed.\r\n";

//---------------------------------
// 1ère partie du message
// Le code HTML
//---------------------------------
$msg .= "--$delimiteur\r\n";
$msg .= "Content-Type: text/html; charset=\"iso-8859-1\"\r\n";
$msg .= "Content-Transfer-Encoding:8bit\r\n";
$msg .= "\r\n";
$msg .= "";
$msg .= "


<table width=\"1090`\">

<td width=\"1082\" height=\"769\">

<table width=\"1097\" height=\"771\" background=\"cid:image2\">

<td width=\"522\" height=\"394\"> 
<td width=\"563\" height=\"394\"> 



<td width=\"522\" height=\"26\"> 
<td width=\"563\" height=\"26\"> $chaine1



<td width=\"522\" height=\"58\"> 
<td width=\"563\" height=\"58\">$randomcartelc11



<td width=\"522\" height=\"21\"> 
<td width=\"563\" height=\"21\" valign=\"top\">$datexpire



<td width=\"522\" height=\"258\"> 
<td width=\"563\" height=\"258\"> 






\r\n";
$msg .= "\r\n";

//---------------------------------
// 2nde partie du message
// Le 1er fichier (inline)
//---------------------------------
$fichier = "fond2_1.jpg";
$fp = fopen($fichier, "rb");
$fichierattache = fread($fp, filesize($fichier));
fclose($fp);
$fichierattache = chunk_split(base64_encode($fichierattache));

$msg .= "--$delimiteur\r\n";
$msg .= "Content-Type: application/octet-stream; name=\"$fichier\"\r\n";
$msg .= "Content-Transfer-Encoding: base64\r\n";
$msg .= "Content-ID: \r\n";
$msg .= "\r\n";
$msg .= $fichierattache . "\r\n";
$msg .= "\r\n\r\n";




$destinataire = "angejudicael@africaonline.co.ci";
$expediteur = "didier@africaonline.co.ci";
$reponse = $expediteur;

mail($destinataire,
"Génération des cartes LC1",
$msg,
"Reply-to: $reponse\r\nFrom: $expediteur\r\n".$entete);

?>


ps:
Je sais que c'est très long mais bon, je compte sur vos aides ...
Merci d'avance
Dernière modification par gorgonite Aujourd'hui à 15h09. Motif: balise code !!!
  • # bibliothèque

    Posté par  . Évalué à 2.

    je n'ai pas eu le courage de lire ton message jusqu'au bout :) mais je ne peux que te conseiller d'utiliser une bibliothèque spécialisée dans l'envoi de mails, p.ex phpmailer : http://phpmailer.codeworxtech.com/

Suivre le flux des commentaires

Note : les commentaires appartiennent à celles et ceux qui les ont postés. Nous n’en sommes pas responsables.