Ejemplo n.º 1
0
 private function afficher_champs($actif, $langue, $style_p)
 {
     $nom = $this->obj_texte->get_label_nom($langue);
     $prenom = $this->obj_texte->get_label_prenom($langue);
     $tel = $this->obj_texte->get_label_tel($langue);
     $email = $this->obj_texte->get_label_email($langue);
     $message = $this->obj_texte->get_label_message($langue);
     $captcha = $this->obj_texte->get_label_captcha($langue);
     $envoyer = $this->obj_texte->get_label_envoyer($langue);
     $disabled = $actif ? "" : " disabled=\"disabled\"";
     $suffixe_id_form = $this->version_courte ? "_court" : "_long";
     if (strlen($style_p) > 0) {
         $style_p = " " . _CSS_PREFIXE_TEXTE . $style_p;
     }
     $mail_util = new mail_util();
     $autorisation = $mail_util->check_flooding();
     if ($autorisation) {
         $action_php = _PHP_PATH_INCLUDE;
         $action_php .= $this->version_courte ? _HTML_PATH_SUBMIT_FORM_COURT : _HTML_PATH_SUBMIT_FORM_LONG;
     } else {
         $action_php = "#";
     }
     echo "<div class=\"formulaire_cadre\">" . _HTML_FIN_LIGNE;
     echo "<form id=\"id_form_contact" . $suffixe_id_form . "\" method=\"post\" action=\"" . $action_php . "\">" . _HTML_FIN_LIGNE;
     // Champs du formulaire
     $this->ecrire_contact_texte($style_p, $this->style, true, $nom, "nom", false, false, $actif);
     if (!$this->version_courte) {
         $this->ecrire_contact_texte($style_p, $this->style, true, $prenom, "prenom", false, false, $actif);
         $this->ecrire_contact_texte($style_p, $this->style, false, $tel, "tel", true, false, $actif);
     }
     $this->ecrire_contact_texte($style_p, $this->style, true, $email, "email", false, true, $actif);
     $this->ecrire_contact_message($style_p, $this->style, true, $message, "message", $actif);
     // Captcha
     if (!$this->version_courte) {
         echo "<p class=\"paragraphe" . $style_p . "\">" . _HTML_FIN_LIGNE;
         echo "<label class=\"champ_label\" for=\"id_captcha\">" . $captcha . "<span class=\"champ_obligatoire\">&nbsp;(*)</span></label>" . _HTML_FIN_LIGNE;
         $classe = "champ_tres_court";
         if (strlen($this->style) > 0) {
             $classe .= " " . _CSS_PREFIXE_FORMULAIRE_CHAMP . $this->style;
         }
         echo "<span id=\"q_captcha\">&nbsp;</span><input class=\"champ_saisie " . $classe . "\" type=\"text\" id=\"id_captcha\" name=\"captcha\" size=\"5\"" . $disabled . "/>" . _HTML_FIN_LIGNE;
         echo "</p>" . _HTML_FIN_LIGNE;
         echo "<p class=\"champ_erreur\" id=\"err_captcha\">&nbsp;</p>" . _HTML_FIN_LIGNE;
     }
     echo "<p class=\"paragraphe\">" . _HTML_FIN_LIGNE;
     echo "<input id=\"id_action\" type=\"hidden\" name=\"action\" value=\"send\" />" . _HTML_FIN_LIGNE;
     echo "<input type=\"submit\" name=\"send\" class=\"bouton_envoyer\" value=\"" . $envoyer . "\"" . $disabled . "/>" . _HTML_FIN_LIGNE;
     echo "</p>" . _HTML_FIN_LIGNE;
     echo "<div class=\"formulaire_separation\"></div>" . _HTML_FIN_LIGNE;
     echo "<p id=\"status_msg\" class=\"paragraphe\" style=\"text-align:center;\">&nbsp;</p>" . _HTML_FIN_LIGNE;
     echo "</form>" . _HTML_FIN_LIGNE;
     echo "</div>" . _HTML_FIN_LIGNE;
 }
Ejemplo n.º 2
0
<?php

require_once 'internet_message_format.inc';
require_once 'mail_send_command.inc';
$mobj = new internet_message_format();
$email = '*****@*****.**';
$mobj->set_from('*****@*****.**', "古庄");
$mobj->push_to($email);
$mobj->set_subject('テスト');
$mobj->set_body('ほげらむげら');
$mobj->set_envelope_from(mail_util::make_verp('*****@*****.**', $email));
$sobj = new mail_send_command();
$sobj->send($mobj);
Ejemplo n.º 3
0
<?php

require_once "mail_util.php";
// Initialisation des paramètres
$mail_util = new mail_util();
$mail_util->ajouter_param(true, "action", _CHAMP_FORMAT_ACTION);
$mail_util->ajouter_param(true, "nom", _CHAMP_FORMAT_TEXTE);
$mail_util->ajouter_param(true, "email", _CHAMP_FORMAT_EMAIL);
$mail_util->ajouter_param(true, "message", _CHAMP_FORMAT_TEXTE);
// Contrôle des champs du formulaire
$err = $mail_util->creer_err_json(_MAIL_NOERR, $json);
if ($err) {
    echo $json;
    return false;
}
// Récupération des valeurs
list($action, $nom, $email, $msg) = $mail_util->lire_params();
// Fabrication du message
$tab_info = $mail_util->get_info();
$racine = $tab_info[_SITE_RACINE];
$destinataire = $tab_info[_SITE_DESTINATAIRE];
if ($destinataire) {
    $titre = "Demande de contact depuis le site " . $racine;
    $message = "De la part de : " . $nom . "<br>";
    $message .= "Adresse email : " . $email . "<br>";
    $message .= "Message : <br>";
    $message .= nl2br($msg);
    // Envoi du message
    $ret = $mail_util->envoi_mail($nom, $email, $destinataire, $titre, $message);
    $err = $mail_util->creer_err_json($ret, $json);
    echo $json;