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: forgot@URL.co.cc";
mail("$email", "$subject", "$message", $headers);
?>

Link to comment
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: forgot@URL.co.cc";
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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

×
×
  • 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.