You must fill every fields
Vous devez remplir tous les champs'; exit; } if($emailValidator->isValid($email) && trim($name) != '' && trim($msg) != ''){ include 'Zend/Mail.php'; $body = 'Message de '.$name.' ('.$email.")\n\n"; $body .= $msg; $message = new Zend_Mail('utf-8'); $message->setFrom($email, 'Contact') ->setSubject('Un message du site (ref : '.$from.')') ->setBodyText($body) ->setReplyTo($email, $name) ->addTo('mail@example.net'); $message->send(); echo 'ok'; exit; }else{ $errorType = $emailValidator->getErrors(); if(isset($errorType[0])){ $errormsg = $emailValidator->getMessageTemplates(); echo '
Email : '.str_replace('%value%', $email, $errormsg[$errorType[0]]).'
'; exit; } } }