0
I’m trying to use Phpmailer to send emails but it doesn’t work. It gives me error 500! I use Hostinger.com to host my website. Here is the code:
$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 :(";
}
Thanks for the help ;)
– Pedro Brito