# Copyright (c) 2007 Erwan Briand # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # ***** END LICENSE BLOCK ***** session_start(); require_once("include/config.inc.php"); $mail = $_POST['titre']; $ma = mysql_query("SELECT * FROM member WHERE email = '$mail' "); if (mysql_num_rows($ma) == 0) { exit("Error."); } $mb = mysql_fetch_array($ma); $code = $mb['passe']; $monsieur = $mb['pseudo']; $avant1 = "Confidential code: ".$code; $subject = stripslashes("CodingTeam - Password resetting"); $body_html = stripslashes($avant1); $from = "CodingTeam "; $body_simple = $avant1; $body_plain = $avant1; $boundary = md5(uniqid(time())); $headers = 'From: ' . $from . "\n"; $headers .= 'To: '.$monsieur.' <'.$mail.">\n"; $headers .= 'Return-Path: ' . $from . "\n"; $headers .= 'MIME-Version: 1.0' ."\n"; $headers .= 'Content-Type: multipart/alternative; boundary="' . $boundary . '"' . "\n\n"; $headers .= $body_simple . "\n"; $headers .= '--' . $boundary . "\n"; $headers .= 'Content-Type: text/plain; charset=UTF-8' ."\n"; $headers .= 'Content-Transfer-Encoding: 8bit'. "\n\n"; $headers .= $body_plain . "\n"; $headers .= '--' . $boundary . "\n"; $headers .= 'Content-Type: text/HTML; charset=UTF-8' ."\n"; $headers .= 'Content-Transfer-Encoding: 8bit'. "\n\n"; $headers .= $body_html . "\n"; $headers .= '--' . $boundary . "--\n"; $mailOk=mail('', $subject,'', $headers); if ($mailOk) { echo"Check your mail!"; } ?>