Bonsoir,
Bon. J'ai du effectué des démarches auprès de ma box SFR pour qu'elle accepte d'envoyer des mail pour un autre STMP que elle.
Et en fait, il s'avère qu'avec la configuration que je présenterai ci-après, j'ai le message de confirmation sans messages d'erreurs, comme quoi le mail de confirmation est bien envoyé à l'adresse renseignée (donc je fais exprès de mettre mon adresse gmail pour voir si ça marche), mais lorsque je vais dans ma boîte de réception, et bien je n'ai rien... Même dans les spams....
Voici ma configuration :
php.ini
; For Win32 only.
; http://php.net/smtp
;SMTP =
; http://php.net/smtp-port
;smtp_port =
; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from =
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
sendmail_path = "C:\wamp64\sendmail\sendmail.exe"
; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail().
;mail.force_extra_parameters =
; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename
mail.add_x_header = On
; The path to a log file that will log all mail() calls. Log entries include
; the full path of the script, line number, To address and headers.
;mail.log =
; Log mail to syslog (Event Log on Windows).
;mail.log = syslog
sendmail.ini
; you must change mail.mydomain.com to your smtp server,
; or to IIS's "pickup" directory. (generally C:\Inetpub\mailroot\Pickup)
; emails delivered via IIS's pickup directory cause sendmail to
; run quicker, but you won't get error messages back to the calling
; application.
smtp_server=smtp.gmail.com
; smtp port (normally 25)
smtp_port=465
; SMTPS (SSL) support
; auto = use SSL for port 465, otherwise try to use TLS
; ssl = alway use SSL
; tls = always use TLS
; none = never try to use SSL
smtp_ssl=ssl
; the default domain for this server will be read from the registry
; this will be appended to email addresses when one isn't provided
; if you want to override the value in the registry, uncomment and modify
default_domain=gmail.com
; log smtp errors to error.log (defaults to same directory as sendmail.exe)
; uncomment to enable logging
error_logfile=error.log
; create debug log as debug.log (defaults to same directory as sendmail.exe)
; uncomment to enable debugging
;debug_logfile=debug.log
; if your smtp server requires authentication, modify the following two lines
[email protected]
auth_password=monmotdepasse
; if your smtp server uses pop3 before smtp authentication, modify the
; following three lines. do not enable unless it is required.
pop3_server=
pop3_username=
pop3_password=
; force the sender to always be the following email address
; this will only affect the "MAIL FROM" command, it won't modify
; the "From: " header of the message content
force_sender=
; force the sender to always be the following email address
; this will only affect the "RCTP TO" command, it won't modify
; the "To: " header of the message content
force_recipient=
; sendmail will use your hostname and your default_domain in the ehlo/helo
; smtp greeting. you can manually set the ehlo/helo name if required
hostname=
Sans oublier ma partie
register.php
<?php
require('config/db_config.php');
require('includes/functions.php');
if(isset($_POST['inscription'])){
if(not_empty(['civilite','nom','prenom','email','mdp','mdp2','engage'])){
$errors = [];
extract($_POST);
if(mb_strlen($nom) < 3 || mb_strlen($prenom) < 2){
$errors[] = "Vos renseignements ne sont pas conformes, veuillez saisir 3 caractères minimum pour votre nom/prénom.";
}
if(!filter_var($email, FILTER_VALIDATE_EMAIL)){
$errors[] = "Votre adresse email a un format non adapté.";
}
if(mb_strlen($mdp) < 6){
$errors[] = "Mot de passe trop court (6 caractères minimum).";
}
else{
if($mdp != $mdp2){
$errors[] = "Les deux mots de passe ne corrrespondent pas.";
}
}
if(is_already_in_use('email',$email,'users')){
$errors[] = "L'adresse email saisie est déjà utilisée pour un compte.";
}
if(count($errors)== 0){
$to = $email;
$subject = WEBSITENAME. " - ACTIVATION DE COMPTE";
$token = sha1($nom.$email.$mdp);
ob_start();
require('templates/emails/active.tmpl.php');
$content = ob_get_clean();
$headers = 'MIME-VERSION : 1.0'.'\r\n';
$headers .= 'Content-type: text/html; charset=iso-8859-1'.'\r\n';
mail($to,$subject,$content,$headers);
echo "Un mail d'activation vous a été envoyé.";
}
}
else{
$errors[] = "Veuillez renseigner tous les champs s'il vous plaît.";
}
}
?>
Donc c'est cool mais bon, j'aimerais poursuivre sur mon projet
À votre avis ?