I'm trying to send an email using my cpanel account and the phpmailler class but I'm not getting success, the code I'm using is the same as the PHPMailler documentation, how should I proceed? , would anyone have a fucnional code to share? Thank you.
require_once(Yii::app()->basePath . '/components/PHPMailer-master/PHPMailerAutoload.php');
$mail = new PHPMailer(true); // create a new object
$mail->IsSMTP(); // enable SMTP
$mail->SMTPDebug = 4; // debugging: 1 = errors and messages, 2 = messages only
$mail->SMTPAuth = true; // authentication enabled
$mail->SMTPSecure = 'tls'; // secure transfer enabled REQUIRED for GMail
$mail->Host = "vps.meudominio.com.br";
$mail->Port = 25;
$mail->IsHTML(true);
$mail->Username = "[email protected]";
$mail->Password = "testeste";
$mail->SetFrom("[email protected]");
$mail->Subject = "Testesteaste";
$mail->Body = "<body> <img width='1px' height='1px' src='http://www.testesteste.com.br' /> <h3>hu3hu3h3u3hu</h3> TEEEESTE!!!!</body>";
$mail->AddAddress("[email protected]");
if(!$mail->Send())
{
echo "Mailer Error: " . $mail->ErrorInfo;
}else{
}
exit;