Bonjour, j'essaie d'envoyer des mails via joomla en local. J'ai essayé avec la gestion des contacts de joomla ça marche. Sauf, que je voudrais faire un formulaire plus précis pour l'envoi de message via joomla. Ca ne marche par il me retourne l'erreur :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
Warning: mail() [function.mail]: SMTP server response: 550 5.5.0 <monmail@orange.fr;> malformed address: ;> may not follow <monmail@orange.fr in D:\EasyPHP5.2.10\www\basedonnee\message\envoyer.php on line 91
Il doit avoir un paramètre dans easyphp qui me bloque mais je ne vois pas lequel

php.ini :
[mail function]
; For Win32 only.
SMTP = smtp.orange.fr
smtp_port = 25

; For Win32 only.
sendmail_from = monmail@orange.fr

extension activée :
extension=php_smtp.dll

dans joomla :Serveur de mail : Serveur SMTP
adresse expéditeur : monmail@orange.fr
port SMPT : 25
Hôte SMTP : smtp.orange.fr

Code :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?php
$sujet = $_POST['sujet'];
$priorite = $_POST['priorite'];
$titre = $sujet." ".$priorite;
$salarie = $_POST['salarie'] ;
$date = $_POST['date'] ;
$societe = $_POST['societe'] ;
$nom = $_POST['nom'] ;
$tel = $_POST['tel'] ;
$email = $_POST['email'] ;
$objet = $_POST['objet'] ;
$qui = " ";
 
if (!$_POST['societe'])
{$societe = "Non renseigné";}
if (!$_POST['tel'])
{$tel = "Non renseigné";}
if (!$_POST['email'])
{$email = "Non renseigné";}
 
//Salarié
if ($salarie == "mail1@orange.fr")
{ $qui = "salarie1";}
 
if ($salarie == "mail2@orange.fr")
{ $qui = "salarie2";}
 
//liste email
$liste = "";
 
if (isset($_POST['destinataire'])) 
{
    for ($i = 0, $c = count($_POST['destinataire']); $i < $c; $i++) 
	{
        $liste = $liste.$_POST['destinataire'][$i].";";
    }
}
 
//Envoi du message
     $headers ='From: '.$salarie.''."\n"; 
     $headers .='Content-Type: text/html; charset="iso-8859-1"'."\n"; 
     $headers .='Content-Transfer-Encoding: 8bit'; 
 
$message = "
<html>
<head>
</head>
<body>
<font color='#006FB7'><strong>Message envoyé par : </strong></font> $qui <br>
<font color='#006FB7'><strong>le : </strong></font> $date <br>
<font color='#006FB7'><strong>Société : </strong></font> $societe <br>
<font color='#006FB7'><strong>Contact : </strong></font> $nom <br>
<font color='#006FB7'><strong>Téléphone : </strong></font> $tel <br>
<font color='#006FB7'><strong>Réponse par email : </strong></font> $email <br>
<font color='#006FB7'><strong>Objet du message : </strong></font> $objet <br>
</body>
</html>";
 
//Affichage envoi email
if (mail($liste, $titre, $message, $headers))
{// Si le mail a bien été envoyé, message de confirmation
$page = "
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'
'http://www.w3.org/TR/html4/loose.dtd'>
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
<title>Envoi d'un message</title>
</head>

<body>
<table width='777' border='0' cellspacing='0' cellpadding='0' align='center'>
  <tr>
    <td><div align='center'>Le message a bien &eacute;t&eacute; envoy&eacute; aux adresses : $liste </div></td>
  </tr>
</table>
</body>
</html>";
echo $page;
}
else
{// sinon, message d'erreur.
$page = " 
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'
'http://www.w3.org/TR/html4/loose.dtd'>
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
<title>Envoi d'un message</title>
</head>

<body>
<table width='777' border='0' cellspacing='0' cellpadding='0' align='center'>
  <tr>
    <td><div align='center'>Le message n'a pas &eacute;t&eacute; envoy&eacute; &agrave; $qui &agrave; l'adresse $salarie </div></td>
  </tr>
</table>
</body>
</html>";
echo $page;}
?>