diff --git a/lang/fr.php b/lang/fr.php index fb194f9..59e9d5b 100644 --- a/lang/fr.php +++ b/lang/fr.php @@ -12,5 +12,9 @@ $lang=array( 'MAKE_DUEL' => 'Provoquer un duel', 'FIGHT' => 'Baston!', 'DEV-YOUR-OWN-BOT' => 'Developpez votre bot et envoyez le dans cette arène.', - 'DOC_SPECS_LINKS' =>'Voici les spécifications techniques' + 'DOC_SPECS_LINKS' =>'Voici les spécifications techniques', + 'E_MAIL_ADD_BOT_INTRO' => 'Un grand merci pour la participation. Juste un click sur le lien suivant pour valider l\ajout du bot', + 'E_MAIL_ADD_BOT_INTRO_HTML' => '

Un grand merci pour la participation.

Juste un click sur le lien suivant pour valider l\ajout du bot

', + 'E_MAIL_ADD_BOT_SIGNATURE' => 'Gnieark', + 'E_MAIL_ADD_BOT_SIGNATURE_HTML' => '

Gnieark.

', ); \ No newline at end of file diff --git a/src/act.php b/src/act.php index 10e584d..3a257e6 100644 --- a/src/act.php +++ b/src/act.php @@ -38,7 +38,7 @@ switch($_POST['act']){ $alerts.="L'email n'est pas valide\n"; } - //BotDescription=> a voir + @@ -65,8 +65,33 @@ switch($_POST['act']){ '".$secret."'" ); + require_once (__DIR__."/config.php"); require_once (__DIR__."/class.phpmailer.php"); + + + $mail = new PHPMailer; + $mail->isSMTP(); + $mail->SMTPDebug = 2; + $mail->Debugoutput = 'html'; + $mail->Host = $smtpParams['host']; + $mail->Port = $smtpParams['port']; + $mail->SMTPSecure = $smtpParams['secure']; + $mail->SMTPAuth = true; + $mail->Username = $smtpParams['username']; + $mail->Password = $smtpParams['pass']; + $mail->setFrom($smtpParams['username'], 'First Last'); + $mail->Subject = 'BotsArena'; + $mail->msgHTML=$lang['E_MAIL_ADD_BOT_INTRO_HTML'].'

'.BASEURL.'validateBot/'.$secret.'

'.$lang['E_MAIL_ADD_BOT_SIGNATURE_HTML']; + $mail->AltBody = $lang['E_MAIL_ADD_BOT_INTRO']."\n".BASEURL.'validateBot/'.$secret."\n".$lang['E_MAIL_ADD_BOT_SIGNATURE']; + if (!$mail->send()) { + echo "Mailer Error: " . $mail->ErrorInfo; + } else { + echo "Message sent!"; + } + + + } diff --git a/src/config.php.empty b/src/config.php.empty index f2db4aa..1d484aa 100644 --- a/src/config.php.empty +++ b/src/config.php.empty @@ -1,4 +1,5 @@ 'localhost', 'user' => '',