Estou tentando utilizar o PHPMailer para enviar emails porém o mesmo não funciona. Me dá erro 500! Uso hostinger.com para hospedar meu site. Aqui está o código:
$email = new PHPMailer(true);
//Using SMTP
$email->IsSMTP();
//$email->Host = "in-v3.mailjet.com";
$email->Host = "aspmx.l.google.com";
$email->SMTPDebug = 1;
$email->SMTPAuth = true;
$email->Host = "smtp.gmail.com";
$email->Username = $mail;
$email->Password = $pin;
$email->SMTPSecure = "ssl";
$email->Port = 25;
//Not using SMTP anymore
try{
$email->SetFrom (" [email protected]", "Victalium");
$email->Subject = "Account Activation";
$email->AddAddress($mail, $user);
$email->IsHTML(false);
$email->MsgHTML($mail_msg);
$email->Send();
echo "Account created, details:<br>----------------------------------------------------<br>Username: $nick,
<br>Email: $mail, <br>Password: $pin.<br>----------------------------------------------------<br> Please check the verification e-mail sent to activate it :)";
} catch (phpmailerException $e){
echo "Error during registering, sorry :(";
}