Bonjour,

Mon problème est simple: je ne reçois pas de courriel de mon formulaire de contact.

Page du formulaire:
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
<link rel="stylesheet" href="style.css" />
<div style="padding-top:100px">
				<form id="CommentForm" method="post" action="contact-send.php" style="margin-top:-100px"> 
                <?php
          require_once('recaptchalib.php');
          $publickey = "6LdGN-USAAAAAL561ZrKrSITtGfVAYeJJCy6Eauk "; // you got this from the signup page
 
        ?>
 
                        <input type="text" name="ContactName" id="ContactName" placeholder="Nom" />  		 
						<input type="text" name="ContactEmail" id="ContactEmail" placeholder="Courriel" /> 
                        <br>	<br>			  
					<input type="text" name="subject" id="subject" placeholder="Sujet" style="width:500px"/> 
                    <p class="text">  
						<textarea name="ContactComment" placeholder="Entrez votre message"></textarea>  
					</p> <p class="text"><br><?php 
                                 					echo recaptcha_get_html($publickey);?></p>                      
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>
				<a href="http://ca.linkedin.com/pub/fr%C3%A9d%C3%A9ric-leroux/2b/712/296" class="linkedin" title="LinkedIn"></a>
				<a href="https://www.facebook.com/frederic.leroux.921?ref=ts&fref=ts" class="facebook" title="Facebook"></a>
				</td>
    <td><p class="submit">  
						<input type="submit" value="Envoyez" />  
					</p>  
					</td>
  </tr>
</table>
 
 
				</form>
</div>
Envois du formulaire:
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
<style>
#error {background-color:#000;width:100px;top:0;left:0}
#succes {background-color:#000;width:100px;top:0;left:0}
</style>
<?php
require_once('recaptchalib.php');
          $privatekey = "6LdGN-USAAAAAPXux-HWwDsiEHsTMtjZg64jW330"; // you got this from the signup page
$resp = recaptcha_check_answer ($privatekey,
                                $_SERVER["REMOTE_ADDR"],
                                $_POST["recaptcha_challenge_field"],
                                $_POST["recaptcha_response_field"]);
 
  if (!$resp->is_valid) {
    // What happens when the CAPTCHA was entered incorrectly
    die ("<div class=\"error\">Le reCAPTCHA est incorrect. Veuillez recommencer." .
         " <a href='#' onclick='top.location.reload(true); return false;'>OK</a></div>");
  } else {
 
  }
 
 
 
$YourEmailAddress = "mon courriel";	
 
 
 
 
error_reporting (E_ALL ^ E_NOTICE);
$post = (!empty($_POST)) ? true : false;
if($post) {
	function ValidateEmail($email){
 
		$regex = "^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$^";
		$eregi = preg_replace($regex,'', trim($email));
 
		return empty($eregi) ? true : false;
	}
 
	$name = stripslashes($_POST['ContactName']);
	$to = $YourEmailAddress; //trim($_POST['to']);
	$email = trim($_POST['ContactEmail']);
	$subject = stripslashes($_POST['subject']);
	$message = stripslashes($_POST['ContactComment']);
	$error = '';
	$Reply=$to;
	$from=$to;
 
	// Check Name Field
	if(!$name) {
		$error .= 'Veuillez indiquer votre nom.<br />';
	}
 
	// Checks Email Field
	if(!$email) { 
		$error .= 'Veuillez indiquer votre adresse courriel.<br />';
	}
	if($email && !ValidateEmail($email)) {
		$error .= 'Veuillez indiquer une adresse courriel valide.<br />';
	}
 
 
	// Checks Subject Field
	if(!$subject) {
		$error .= 'Veuillez indiquer un sujet.<br />';
	}
 
	// Checks Message (length)
	if(!$message || strlen($message) < 3) {
		$error .= "Veuillez indiquer un message d'au moin 5 caractères.<br />";
	}
 
	// Let's send the email.
	if(!$error) {
		$messages="De: $email <br>";
		$messages.="Nom: $name <br>";
		$messages.="Courriel: $email <br>";
		$messages.="Sujet: $subject <br>";
		$messages.="Message: $message <br>";
		$emailto=$to;
 
		$mail = mail($emailto,$subject,$messages,"De: $from <$Reply>\nReply-To: $Reply \nContent-type: text/html");	
 
		if($mail) {
			echo '<div class="succes">Votre courriel a été envoyé. Merci! <a href="#" onclick="top.location.reload(true); return false;">OK</a></div>';
		}
	} else {
		echo '<div class="error">'.$error.'Veuillez recommencer <a href="#" onclick="top.location.reload(true); return false;">OK</a></div>';
	}
 
}
?>
Merci de votre aide.