Session data as "to" in email

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Any eagle who's capable of seeing WHY this script does not send email?


$sendto = $_SESSION['email_submitted'];
$first_name = $_SESSION['first_name'];
$last_name = $_SESSION['last_name'];

$to = "$sendto";
$subject = "Email confirmation";
$body = "Hello, $first_name, $last_name. This email confirms your
registration \n\n";

$ok = @mail($to,$subject,$from,$body);

if ($ok) {
header('Location: registrationSent.php') ;
} else {
 echo "<p>Damn!</p>";


Re: Session data as "to" in email

Quoted text here. Click to load it

Never mind. I found the error.
I forgot to put  session_write_close(); before redirect.

Site Timeline