So I have an email script which sends a welcome email along with activation link after a user creates an account. However, the registration process works fine but no email get's sent. The script is:
Is there something wrong with it? I've used it before when I first began creating the registration form and it worked. However since fixing a lot of it up it's stopped working. The script is executed with:
PHP:
function sendWelcome($user, $actkey, $email){
$from = "From: ".EMAIL_FROM_NAME." <".EMAIL_FROM_ADDR.">";
$subject = "insight - Welcome!";
$body = $user.",\n\n"
."Welcome! You've just registered at insight with the following information\n\n"
."Username: ".$user."\n"
."You must activate this account before you can use it. To do this click on\n"
."the link below.\n\n "
."http://insight.pcriot.com/activate.php?i=".$user."&id=".$actkey."\n\n"
."- insight";
mail($email,$subject,$body,$from);
}
PHP:
if(EMAIL_WELCOME){
$mailer->sendWelcome($subuser, sha1($subuser.$subemail.DB_SALT), $subemail);
}