This code is for my contact page and it spits out an email that I can read with gmail.

```
<?php
$message = "Sender:" . "\r\n" . $_POST["email"] . "\r\n" . "\r\n" . "Company Name:" . "\r\n" . $_POST["company"] . "\r\n" . "\r\n" .'Message:' . "\r\n" . $_POST["message"];

$to = "EMAIL ADDRESS TAKEN OUT FOR SECURITY PURPOSES, IT'S LEGIT";
$subject = $_POST["title"];
$body = $message; 

$headers = 'From:' . $_POST["email"] . "\r\n" .
    'Reply-To:'  . $_POST["email"] . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

if (mail($to, $subject, $body, $headers)) {
    echo("<p class='form'>You're message was sent successfully! We'll get back to you shortly. In the mean-time... ");
} else {
echo("<p class='form'>Oops! There was an error sending your message.");
}
?>

```

However, when I put this code into another page...

```
    $message = "Hey, testing this. Go to this link <a href='WEB ADDRESS HIDDEN=" .$display ."'>Activate</a>" ;

$subject = "Activate your Account";

if (mail($email, $subject, $message))
{
echo "A verification link was sent to <strong>".$email."</strong>";
}

```

It doesn't send the email! $email is a variable that I used before to insert into a database. The user inputted it. After that I send an email to them but it's not sending. Mail() returns true because it prints the text with the correct email address as well.

What's wrong here? Any suggestions?

I'm new to php so.. try to speak as if you were learning for the first time.

Thanks!

EDIT:

The variables are not related. They don't talk. They have the same names but exist on different pages that have no relation to each other.