Jump to content
Fórum Script Brasil
  • 0

Problema Com Sendmail


Guest asgarotasmeadoram@yahoo.com.br

Question

Guest asgarotasmeadoram@yahoo.com.br

Na parte em vermelho,abaixo, tem um sendmail em php q não consigo fazer funcionar. Por favor me ajudem.

<?php

session_start();

include("admin/config.php");

include( "admin/settings.inc.php");

include( "header.inc.php");

include( "shoppingcart.php");

$cart = new Cart;

include("subheader.inc.php");

// start border

sb("100%",$la_fp_reset_pass,$colour_1,$bg_colour);

// if customer has clicked submit reset

if($reset)

{

// Generate random password

$chars = array(

"a","A","b","B","c","C","d","D","e","E","f","F","g","G","h","H","i","I","j","J", "k","K","l","L","m","M","n","N","o","O","p","P","q","Q","r","R","s","S","t","T", "u","U","v","V","w","W","x","X","y","Y","z","Z","1","2","3","4","5","6","7","8",

"9","0");

$max_chars = count($chars) - 1;

srand((double)microtime()*1000000);

for($i = 0; $i < 8; $i++)

{

$new_pass = ($i == 0) ? $chars[rand(0, $max_chars)] : $new_pass . $chars[rand(0, $max_chars)];

}

// Check e-mail address is valid

if (ereg("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$", $email))

{

$stop = 0;

}

else

{

print "<br><br><p align=\"center\"><b>$la_fp_fog_pass</b><Br><br><font color=red'>$la_customer_email_inval</font><br><br><a href=\"forgot_pass.php?session=$session\" target=\"_self\">$la_customer_try_again</a></p><br><br>";

$stop = 1;

eb($bg_colour,$colour_1);

include( "subfooter.inc.php");

exit;

}

// Check email address is held in database

$result = mysql_query ("select email from ".$prefix."store_customer where email = '$email'");

$count_results = mysql_num_rows($result);

if ($count_results > 0)

{

$stop = 0;

} else

{

$stop = 1;

echo"<br><br><p align=\"center\"><b>$la_fp_fog_pass</b><Br><br><b>$email</b> $la_fp_email_no_exist<Br><Br>$la_fp_email_ent_cor<br><br><a href=\"forgot_pass.php?session=$session\" target=\"_self\">$la_customer_try_again</a></p><br><br>";

}

while ($joao = mysql_fetch_array($result))

{

$email=$joao["email];

}

// If all is ok encrypt password in database and send new password to the users email address

if ($stop <> 1)

{

$passwd = md5($new_pass);

$res = mysql_query ("update ".$prefix."store_customer set password='$passwd' where email = '$email'");

if ($res)

{

echo "<br><br><p align=\"center\"><b>$la_fp_fog_pass</b><br><br>$la_fp_email_new_temp <b>$email</b><Br>$la_fp_change_sec</p><br><br>";

$sendto = $email;

$from = $site_email;

$subject = "$la_fp_fog_pass";

$message = "$la_account_dear $email,\n\n$la_fp_mail_new_pass $new_pass. $la_fp_mail_change \n\n$la_account_ending \n\n$site_business\n\n$la_fp_follow_link\n****************************************************************\n$site_url/new_pass.php?temp=$new_pass&email=$email&language=$session_lang\n*****************************************************************\n\n$la_fp_fail_link\n\n$site_url/account.php";

$headers = "From: $site_email\r\n";

// send e-mail

mail($sendto, $subject, $message, $headers); }

}

}//end if submit

// reset password form before submit

if(!$reset)

{

echo"<div align=\"center\"><br><br>

<form method=\"post\" enctype=\"multipart/form-data\" action=\"forgot_pass.php\">

<table border=\"0\" cellspacing=\"0\" cellpadding=\"2\" align=\"center\">

<tr>

<td colspan=\"2\" width=\"400\" height=\"10\"><b>$la_fp_lost_pass</b></td>

</tr>

<tr>

<td colspan=\"2\" width=\"400\" height=\"10\">$la_fp_explain</td>

</tr>

<tr>

<td width=\"100\" height=\"10\">$la_customer_email</td>

<td height=\"10\" width=\"300\">

<input type=\"text\" class=\"textbox\" name=\"email\">

</td>

</tr>

<tr>

<td width=\"100\" height=\"10\"></td>

<td height=\"10\" width=\"300\">

<input type=\"submit\" name=\"reset\" class=\"submit\" value=\"$la_send_pass\">

</td>

</tr>

<tr>

<td colspan=\"2\" height=\"10\">

</td>

</tr>

</table>

</form>

</div>";

}// end if submit

eb($bg_colour,$colour_1);

include("subfooter.inc.php");

include("footer.inc.php");

?>

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      651.9k
×
×
  • Create New...