Convert line endings from MAC to UNIX
[php-addressbook.git] / register / email_password_sender.php
index 9bd66a1..ce63278 100644 (file)
-<?\r\r
-\r\r
-include "master_inc.php";\r\r
-\r\r
-$email  = $_REQUEST['email'];\r\r
-$sql    = "SELECT * FROM ".$usertable." WHERE email='".mysqli_real_escape_string(trim($email))."'";\r\r
-$result = mysqli_query($db,$sql);\r\r
-\r\r
-// mysqli_num_row is counting table rows\r\r
-$count  = mysqli_num_rows($result);\r\r
-\r\r
-// If result matches $myusername and $mypassword, table row must be 1 row\r\r
-if($count == 0){\r\r
-\r\r
-  die("<font size='2' face='Verdana, Arial, Helvetica, sans-serif'>Sorry but we don't have that email in our system.  <a href='email_password.php'>Please try again.</a>  Thank you!</font>");\r\r
-\r\r
-}else{\r\r
-       \r\r
-  //comes from config which pulls from /inc\r\r
-  $email_body = $forgot_password_email;\r\r
-}\r\r
-               \r\r
-$from        = $from_email;\r\r
-$reply_to    = $reply_to_email;\r\r
-$return_path = $return_path_email;\r\r
-\r\r
-$to = $email;\r\r
-\r\r
-$subject = $forgot_password_email_subject;\r\r
-\r\r
-//***attaches view tracker to link tracked code*** - CCC\r\r
-$mailbody= "$email_body";\r\r
-\r\r
-//____________________________Begin Multipart Mail Sender\r\r
-//add From: header \r\r
-$headers = "From:$from\nReply-to:$reply_to\nReturn-path:$return_path\nJobID:$date\n"; \r\r
-\r\r
-//specify MIME version 1.0 \r\r
-$headers .= "MIME-Version: 1.0\n"; \r\r
-\r\r
-//unique boundary \r\r
-$boundary = uniqid("HTMLDEMO8656856"); \r\r
-\r\r
-//tell e-mail client this e-mail contains//alternate versions \r\r
-$headers.="X-Priority: 3\n";\r\r
-$headers.="Content-Type: multipart/alternative; boundary=\"".$boundary."\"\n";\r\r
-$headers.="Content-Transfer-Encoding: 7bit\n";\r\r
-\r\r
-//message to people with clients who don't \r\r
-//understand MIME \r\r
-$headers .= "This is a MIME encoded message.\n\n"; \r\r
-\r\r
-//plain text version of message \r\r
-$headers .= "--$boundary\n" . \r\r
-   "Content-Type: text/plain; charset=ISO-8859-1\r\n" . \r\r
-   "Content-Transfer-Encoding: base64\n\n"; \r\r
-$headers .= chunk_split(base64_encode("$mailbody")); \r\r
-\r\r
-//HTML version of message \r\r
-$headers .= "--$boundary\n" . \r\r
-   "Content-Type: text/html; charset=ISO-8859-1\n" . \r\r
-   "Content-Transfer-Encoding: base64\n\n"; \r\r
-$headers .= chunk_split(base64_encode("$mailbody")); \r\r
-\r\r
-//send message\r\r
-\r\r
-If (mail("$to", "$subject", "", $headers))\r\r
-{\r\r
-echo"<font size='2' face='Verdana, Arial, Helvetica, sans-serif'>An account verification link has been sent to <b><a href='mailto:$email'>$email</a></b>. This link will allow you to reset your password<br><br> Emails may take up to 10 minutes to arrive.  Check your spam folder also and whitelist this site if you find our message there.  Thanks!<br<br>\r\r
-<a href='login.php'>Back to login</a></font>";\r\r
-}\r\r
-?>\r\r
+<?
+\r
+
+\r
+include "master_inc.php";
+\r
+
+\r
+$email  = $_REQUEST['email'];
+\r
+$sql    = "SELECT * FROM ".$usertable." WHERE email='".mysqli_real_escape_string(trim($email))."'";
+\r
+$result = mysqli_query($db,$sql);
+\r
+
+\r
+// mysqli_num_row is counting table rows
+\r
+$count  = mysqli_num_rows($result);
+\r
+
+\r
+// If result matches $myusername and $mypassword, table row must be 1 row
+\r
+if($count == 0){
+\r
+
+\r
+  die("<font size='2' face='Verdana, Arial, Helvetica, sans-serif'>Sorry but we don't have that email in our system.  <a href='email_password.php'>Please try again.</a>  Thank you!</font>");
+\r
+
+\r
+}else{
+\r
+       
+\r
+  //comes from config which pulls from /inc
+\r
+  $email_body = $forgot_password_email;
+\r
+}
+\r
+               
+\r
+$from        = $from_email;
+\r
+$reply_to    = $reply_to_email;
+\r
+$return_path = $return_path_email;
+\r
+
+\r
+$to = $email;
+\r
+
+\r
+$subject = $forgot_password_email_subject;
+\r
+
+\r
+//***attaches view tracker to link tracked code*** - CCC
+\r
+$mailbody= "$email_body";
+\r
+
+\r
+//____________________________Begin Multipart Mail Sender
+\r
+//add From: header 
+\r
+$headers = "From:$from\nReply-to:$reply_to\nReturn-path:$return_path\nJobID:$date\n"; 
+\r
+
+\r
+//specify MIME version 1.0 
+\r
+$headers .= "MIME-Version: 1.0\n"; 
+\r
+
+\r
+//unique boundary 
+\r
+$boundary = uniqid("HTMLDEMO8656856"); 
+\r
+
+\r
+//tell e-mail client this e-mail contains//alternate versions 
+\r
+$headers.="X-Priority: 3\n";
+\r
+$headers.="Content-Type: multipart/alternative; boundary=\"".$boundary."\"\n";
+\r
+$headers.="Content-Transfer-Encoding: 7bit\n";
+\r
+
+\r
+//message to people with clients who don't 
+\r
+//understand MIME 
+\r
+$headers .= "This is a MIME encoded message.\n\n"; 
+\r
+
+\r
+//plain text version of message 
+\r
+$headers .= "--$boundary\n" . 
+\r
+   "Content-Type: text/plain; charset=ISO-8859-1\r\n" . 
+\r
+   "Content-Transfer-Encoding: base64\n\n"; 
+\r
+$headers .= chunk_split(base64_encode("$mailbody")); 
+\r
+
+\r
+//HTML version of message 
+\r
+$headers .= "--$boundary\n" . 
+\r
+   "Content-Type: text/html; charset=ISO-8859-1\n" . 
+\r
+   "Content-Transfer-Encoding: base64\n\n"; 
+\r
+$headers .= chunk_split(base64_encode("$mailbody")); 
+\r
+
+\r
+//send message
+\r
+
+\r
+If (mail("$to", "$subject", "", $headers))
+\r
+{
+\r
+echo"<font size='2' face='Verdana, Arial, Helvetica, sans-serif'>An account verification link has been sent to <b><a href='mailto:$email'>$email</a></b>. This link will allow you to reset your password<br><br> Emails may take up to 10 minutes to arrive.  Check your spam folder also and whitelist this site if you find our message there.  Thanks!<br<br>
+\r
+<a href='login.php'>Back to login</a></font>";
+\r
+}
+\r
+?>
+\r