I've been working on a login system and keep running into errors when trying to send e-mails over PHPMailer, can't get any better in-site into the errors so any help?
Function that doesn't work:
function SendUserConfirmationEmail(&$formvars)
{
$mailer = new PHPMailer(true);
$mailer->CharSet = 'utf-8';
$mailer->AddAddress($formvars['email'],$formvars['name']);
$mailer->Subject = "Your registration with ".$this->sitename;
$mailer->From = $this->GetFromAddress();
$confirmcode = $formvars['confirmcode'];
$confirm_url = $this->GetAbsoluteURLFolder().'/confirmreg.php?code='.$confirmcode;
$mailer->Body ="Hello ".$formvars['name']."\r\n\r\n".
"Thanks for your registration with ".$this->sitename."\r\n".
"Please click the link below to confirm your registration.\r\n".
"$confirm_url\r\n".
"\r\n".
"Regards,\r\n".
"Webmaster\r\n".
$this->sitename;
if(!$mailer->Send())
{
$mailer->ErrorInfo;
$this->HandleError("Failed sending registration confirmation email.");
return false;
}
return true;
}
UPDATE:
Sorry for no activity, I had to make myself a autoloader and request the class.phpmailer file as require_once!