Jump to content

[SOLVED] using mail() function.


seany123

Recommended Posts

can anyone see anything wrong with this?, its not sending to the email address.

 

<?php
$query1 = $db->execute("update `players` set `recover`='$validate' where `email`='$email'");
$subject = "Forgot Password";
$message = "Your Username is $user \n\nYour Recover password link is: http://URL.co.cc/recover.php?recover=$validate \n\nThis is an automatic email so please do not respond \n\nWARNING: DO NOT GIVE OUT THE ADDRESS ABOVE TO ANYONE ";
$headers .= "From: [email protected]";
mail("$email", "$subject", "$message", $headers);
?>

Link to comment
https://forums.phpfreaks.com/topic/158747-solved-using-mail-function/
Share on other sites

can anyone see anything wrong with this?, its not sending to the email address.

 

<?php
$query1 = $db->execute("update `players` set `recover`='$validate' where `email`='$email'");
$subject = "Forgot Password";
$message = "Your Username is $user \n\nYour Recover password link is: http://URL.co.cc/recover.php?recover=$validate \n\nThis is an automatic email so please do not respond \n\nWARNING: DO NOT GIVE OUT THE ADDRESS ABOVE TO ANYONE ";
$headers .= "From: [email protected]";
mail("$email", "$subject", "$message", $headers);
?>

Where is $email obtained from? (Also, the quotes used in the first three parameters of mail() are unnecessary.)

 

Where is $email obtained from? (Also, the quotes used in the first three parameters of mail() are unnecessary.)

 

$email is obtained from the players database.

 

 

<?php
$email = $_POST['email'];
$query = $db->execute("select * from `players` where `email`='$email'");
?>

 

I'm also going to go ahead and assume that you have configured/setup mail?

 

actually i havnt done that yet... i had a look and could only find 1 thing to do with sending mail on my hosts cp...

 

Sendmail path:  /usr/sbin/sendmail

got a few little warnings but nothing i dont think should stop the mail()

 

 

errors:

 

Notice: Undefined variable: lang in /home/www/forgot.php on line 10

 

Notice: Undefined variable: headers in /home/www/forgot.php on line 36

 

Warning: Cannot modify header information - headers already sent by (output started at /home/www/forgot.php:10) in /home/www/forgot.php on line 38

 

Notice: Undefined variable: player in /home/www/templates/header.php on line 2

 

Notice: Undefined variable: error in /home/www/templates/header.php on line 60

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.